Skip to content

Commit f1360e9

Browse files
Added parseExporterTimeMetricDefinition() (#38)
* [add] Added parseExporterTimeMetricDefinition() * Bumping version from 0.1.37 to 0.1.38
1 parent fcd8d91 commit f1360e9

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
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.37"
3+
version = "0.1.38"
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"

redisbench_admin/utils/benchmark_config.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,41 @@
11
from jsonpath_ng import parse
22

33

4+
<<<<<<< HEAD
5+
def parseExporterMetricsDefinition(
6+
benchmark_config: dict, configkey: str = "redistimeseries"
7+
):
8+
metrics = []
9+
if configkey in benchmark_config:
10+
if "metrics" in benchmark_config[configkey]:
11+
for metric_name in benchmark_config[configkey]["metrics"]:
12+
=======
413
def parseExporterMetricsDefinition(benchmark_config, configkey="redistimeseries"):
514
metrics = []
615
if configkey in benchmark_config:
716
if "metrics" in benchmark_config[configkey]:
817
for metric_name in benchmark_config[configkey][
918
"metrics"
1019
]:
20+
>>>>>>> origin/master
1121
metrics.append(metric_name)
1222
return metrics
1323

1424

25+
<<<<<<< HEAD
26+
def parseExporterTimeMetricDefinition(
27+
benchmark_config: dict, configkey: str = "redistimeseries"
28+
):
29+
metricPath = None
30+
if "timemetric" in benchmark_config[configkey]:
31+
metricPath = benchmark_config[configkey]["timemetric"]
32+
return metricPath
33+
34+
35+
def parseExporterTimeMetric(metricPath: str, results_dict: dict):
36+
jsonpath_expr = parse(metricPath)
37+
datapoints_timestamp = int(jsonpath_expr.find(results_dict)[0].value)
38+
=======
1539
def parseExporterTimeMetric(benchmark_config, results_dict, configkey="redistimeseries"):
1640
datapoints_timestamp = None
1741
if "timemetric" in benchmark_config[configkey]:
@@ -20,4 +44,5 @@ def parseExporterTimeMetric(benchmark_config, results_dict, configkey="redistime
2044
datapoints_timestamp = int(
2145
jsonpath_expr.find(results_dict)[0].value
2246
)
47+
>>>>>>> origin/master
2348
return datapoints_timestamp

redisbench_admin/utils/remote.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,11 @@ def get_run_full_filename(
283283
return benchmark_output_filename
284284

285285

286-
def fetchRemoteSetupFromConfig(remote_setup_config, repo="https://github.com/RedisLabsModules/testing-infrastructure.git",branch="master"):
286+
def fetchRemoteSetupFromConfig(
287+
remote_setup_config,
288+
repo="https://github.com/RedisLabsModules/testing-infrastructure.git",
289+
branch="master",
290+
):
287291
type = None
288292
setup = None
289293
for remote_setup_property in remote_setup_config:
@@ -292,7 +296,7 @@ def fetchRemoteSetupFromConfig(remote_setup_config, repo="https://github.com/Red
292296
if "setup" in remote_setup_property:
293297
setup = remote_setup_property["setup"]
294298
# fetch terraform folder
295-
path = "/terraform/{}-{}".format(type,setup)
299+
path = "/terraform/{}-{}".format(type, setup)
296300
temporary_dir = tempfile.mkdtemp()
297301
logging.info(
298302
"Fetching infrastructure definition from git repo {}/{} (branch={})".format(

0 commit comments

Comments
 (0)