1
1
from jsonpath_ng import parse
2
2
3
3
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
+ == == == =
4
13
def parseExporterMetricsDefinition (benchmark_config , configkey = "redistimeseries" ):
5
14
metrics = []
6
15
if configkey in benchmark_config :
7
16
if "metrics" in benchmark_config [configkey ]:
8
17
for metric_name in benchmark_config [configkey ][
9
18
"metrics"
10
19
]:
20
+ > >> >> >> origin / master
11
21
metrics .append (metric_name )
12
22
return metrics
13
23
14
24
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
+ == == == =
15
39
def parseExporterTimeMetric (benchmark_config , results_dict , configkey = "redistimeseries" ):
16
40
datapoints_timestamp = None
17
41
if "timemetric" in benchmark_config [configkey ]:
@@ -20,4 +44,5 @@ def parseExporterTimeMetric(benchmark_config, results_dict, configkey="redistime
20
44
datapoints_timestamp = int (
21
45
jsonpath_expr .find (results_dict )[0 ].value
22
46
)
47
+ > >> >> >> origin / master
23
48
return datapoints_timestamp
0 commit comments