forked from zilliztech/VectorDBBench
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: min.tian <min.tian.cn@gmail.com>
- Loading branch information
1 parent
153a518
commit 8b6dfc8
Showing
11 changed files
with
123 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import plotly.express as px | ||
from vectordb_bench.frontend.config.styles import COLOR_MAP | ||
from vectordb_bench.metric import metricUnitMap | ||
|
||
|
||
def drawCharts(st, allData, failedTasks, _): | ||
dataset_names = list(set([data["dataset_name"] for data in allData])) | ||
dataset_names.sort() | ||
for dataset_name in dataset_names: | ||
container = st.container() | ||
container.subheader(dataset_name) | ||
data = [d for d in allData if d["dataset_name"] == dataset_name] | ||
drawChartByMetric(container, data) | ||
|
||
|
||
def drawChartByMetric(st, data): | ||
metrics = ["qps", "recall"] | ||
columns = st.columns(len(metrics)) | ||
for i, metric in enumerate(metrics): | ||
container = columns[i] | ||
container.markdown(f"#### {metric}") | ||
drawChart(container, data, metric) | ||
|
||
|
||
def getRange(metric, data, padding_multipliers): | ||
minV = min([d.get(metric, 0) for d in data]) | ||
maxV = max([d.get(metric, 0) for d in data]) | ||
padding = maxV - minV | ||
rangeV = [ | ||
minV - padding * padding_multipliers[0], | ||
maxV + padding * padding_multipliers[1], | ||
] | ||
return rangeV | ||
|
||
|
||
def drawChart(st, data: list[object], metric): | ||
unit = metricUnitMap.get(metric, "") | ||
x = "filter_rate" | ||
xrange = getRange(x, data, [0.05, 0.1]) | ||
|
||
y = metric | ||
yrange = getRange(y, data, [0.2, 0.1]) | ||
|
||
data.sort(key=lambda a: a[x]) | ||
|
||
fig = px.line( | ||
data, | ||
x=x, | ||
y=y, | ||
color="db", | ||
line_group="db_name", | ||
color_discrete_map=COLOR_MAP, | ||
text=metric, | ||
markers=True, | ||
) | ||
fig.update_xaxes(range=xrange) | ||
fig.update_yaxes(range=yrange) | ||
fig.update_traces(textposition="bottom right", texttemplate="%{y:,.4~r}" + unit) | ||
fig.update_layout( | ||
margin=dict(l=0, r=0, t=40, b=0, pad=8), | ||
legend=dict( | ||
orientation="h", yanchor="bottom", y=1, xanchor="right", x=1, title="" | ||
), | ||
) | ||
st.plotly_chart(fig, use_container_width=True) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
vectordb_bench/results/Milvus/result_20240805_2024080517_milvus.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"run_id": "e54a054431834e7eae59c62acbc226b0", "task_label": "2024080517", "results": [{"metrics": {"max_load_count": 0, "load_duration": 0.0, "qps": 0.0, "serial_latency_p99": 0.0, "recall": 0.0, "ndcg": 0.0, "conc_num_list": [], "conc_qps_list": [], "conc_latency_p99_list": []}, "task_config": {"db": "Milvus", "db_config": {"db_label": "", "version": "", "note": "", "uri": "**********"}, "db_case_config": {"index": "HNSW", "metric_type": "COSINE", "M": 30, "efConstruction": 360, "ef": 100}, "case_config": {"case_id": 50, "custom_case": null, "k": 100, "concurrency_search_config": {"num_concurrency": [10], "concurrency_duration": 30}}, "stages": ["drop_old", "load", "search_serial", "search_concurrent"]}, "label": "x"}], "file_fmt": "result_{}_{}_{}.json"} |
1 change: 1 addition & 0 deletions
1
vectordb_bench/results/Milvus/result_20240805_2024080518_milvus.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"run_id": "a509694394034f35b6c1c478f038ed47", "task_label": "2024080518", "results": [{"metrics": {"max_load_count": 0, "load_duration": 0.0, "qps": 0.0, "serial_latency_p99": 0.0, "recall": 0.0, "ndcg": 0.0, "conc_num_list": [], "conc_qps_list": [], "conc_latency_p99_list": []}, "task_config": {"db": "Milvus", "db_config": {"db_label": "", "version": "", "note": "", "uri": "**********"}, "db_case_config": {"index": "HNSW", "metric_type": "COSINE", "M": 30, "efConstruction": 360, "ef": 100}, "case_config": {"case_id": 50, "custom_case": null, "k": 100, "concurrency_search_config": {"num_concurrency": [10], "concurrency_duration": 30}}, "stages": ["drop_old", "load", "search_serial", "search_concurrent"]}, "label": "x"}], "file_fmt": "result_{}_{}_{}.json"} |