11from 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+ == == == =
413def 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+ == == == =
1539def 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
0 commit comments