Skip to content

Commit 57a5ec3

Browse files
committed
misc: add readme and license; change proj name
1 parent ceaa517 commit 57a5ec3

File tree

5 files changed

+76
-5
lines changed

5 files changed

+76
-5
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Pavlo Dmytrenko
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# ClickHouse Benchmark Comparison Tool
2+
3+
## Description
4+
5+
This is a web-based tool for comparing ClickHouse query benchmark results. It allows you to input and visualize performance metrics for two different ClickHouse queries, providing insights into their relative efficiency and performance characteristics.
6+
7+
Key features:
8+
- Input areas for two SQL queries and their respective benchmark results
9+
- Parsing and visualization of benchmark data
10+
- Performance metrics comparison charts (QPS, RPS, MiB/s, etc.)
11+
- Query latency distribution chart
12+
- Key percentile latencies comparison
13+
- Raw data display
14+
15+
## Installation
16+
17+
To set up the project, follow these steps:
18+
19+
1. Clone the repository
20+
2. Ensure you have Python 3.12+ installed.
21+
3. Install the required dependencies:
22+
23+
```
24+
pip install -r requirements.txt
25+
```
26+
27+
## Usage
28+
29+
To run the application:
30+
1. Navigate to the project directory in your terminal.
31+
2. Run the following command:
32+
33+
```
34+
streamlit run viz.py
35+
```
36+
37+
3. The application will start, and you should see output similar to:
38+
39+
```
40+
You can now view your Streamlit app in your browser.
41+
Local URL: http://localhost:8501
42+
Network URL: http://192.168.1.5:8501
43+
```
44+
45+
4. Open the provided URL in your web browser to access the tool.
46+
47+
5. In the web interface:
48+
- Enter your ClickHouse SQL queries in the "Query 1" and "Query 2" text areas.
49+
- Paste the corresponding benchmark results in the "Benchmark results" text areas.
50+
- The tool will automatically parse the input and generate visualizations and comparisons.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
2-
name = "ch-bench"
2+
name = "ch_benchviz"
33
version = "0.1.0"
4-
description = "Add your description here"
4+
description = "A Streamlit-based tool for visualizing and comparing ClickHouse query benchmark results"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

viz.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
import sqlparse
77

8-
DEFAULT_DATA = """clickhouse-systemlogs-eu-aiven-management-pavdmyt-test.avns.net:20001, queries: 30, QPS: 28.404, RPS: 17619645.884, MiB/s: 566.200, result RPS: 59733.005, result MiB/s: 14.272.
8+
DEFAULT_DATA = """localhost:9000, queries: 30, QPS: 28.404, RPS: 17619645.884, MiB/s: 566.200, result RPS: 59733.005, result MiB/s: 14.272.
99
1010
0.000% 0.013 sec.
1111
10.000% 0.013 sec.
@@ -27,7 +27,7 @@
2727
STATUS_REGEX = re.compile(
2828
r"([\w.-]+:\d+),\s*queries:\s*(\d+),\s*QPS:\s*([\d.]+),\s*RPS:\s*([\d.]+),\s*MiB/s:\s*([\d.]+),\s*result RPS:\s*([\d.]+),\s*result MiB/s:\s*([\d.]+)"
2929
)
30-
DEFAULT_QUERY = """SELECT * FROM messages WHERE service_id = 40 LIMIT 50;"""
30+
DEFAULT_QUERY = """SELECT * FROM messages LIMIT 50;"""
3131
PERCENTILE_REGEX = re.compile(r"(\d+\.?\d*)%\s+(\d+\.\d+)\s+sec")
3232
KEY_PERCENTILES = [50.0, 95.0, 99.0]
3333
COLORSCHEME = px.colors.qualitative.D3

0 commit comments

Comments
 (0)