Skip to content

Commit fcd8d91

Browse files
Added helper code to parse benchmark config file (#37)
* [add] Added helper code to parse benchmark config file * Bumping version from 0.1.36 to 0.1.37
1 parent d1f837b commit fcd8d91

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.1.36"
3+
version = "0.1.37"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <[email protected]>"]
66
readme = "README.md"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from jsonpath_ng import parse
2+
3+
4+
def parseExporterMetricsDefinition(benchmark_config, configkey="redistimeseries"):
5+
metrics = []
6+
if configkey in benchmark_config:
7+
if "metrics" in benchmark_config[configkey]:
8+
for metric_name in benchmark_config[configkey][
9+
"metrics"
10+
]:
11+
metrics.append(metric_name)
12+
return metrics
13+
14+
15+
def parseExporterTimeMetric(benchmark_config, results_dict, configkey="redistimeseries"):
16+
datapoints_timestamp = None
17+
if "timemetric" in benchmark_config[configkey]:
18+
tspath = benchmark_config[configkey]["timemetric"]
19+
jsonpath_expr = parse(tspath)
20+
datapoints_timestamp = int(
21+
jsonpath_expr.find(results_dict)[0].value
22+
)
23+
return datapoints_timestamp

0 commit comments

Comments
 (0)