Skip to content

Commit 1aa2326

Browse files
Enabled tracking overall timeseries and datasets (#98)
* [fix] Fixes for local and remote runs (redisgraph related) * [add] Increasing test coverage using docker image on ci * [fix] fixed PEP standard * [wip] refactored run_remote * [wip] merged common code across local/remote runs * [wip] further merge of common local/remote logic * [wip] further merge of common local/remote logic * [wip] further reusing common logic on remote/local * [wip] continuing the merge of codepaths in local/remote run * [wip] enabled tracking overall timeseries and datasets
1 parent 683383d commit 1aa2326

15 files changed

+1028
-672
lines changed

.github/workflows/poetry-ci-test-lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ jobs:
99
pytest:
1010
name: Linting, testing, and compliance
1111
runs-on: ubuntu-latest
12+
services:
13+
rts-service:
14+
image: redislabs/redistimeseries:latest
15+
ports:
16+
- 6379:6379
1217
env:
1318
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1419
steps:

redisbench_admin/run/common.py

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import datetime as dt
22
import logging
3-
import re
4-
5-
import yaml
63

74
from redisbench_admin.run.redis_benchmark.redis_benchmark import (
85
prepare_redis_benchmark_command,
@@ -15,8 +12,6 @@
1512
)
1613
from redisbench_admin.run.ycsb.ycsb import prepare_ycsb_benchmark_command
1714
from redisbench_admin.utils.benchmark_config import (
18-
parse_exporter_metrics_definition,
19-
parse_exporter_timemetric_definition,
2015
parse_exporter_timemetric,
2116
)
2217
from redisbench_admin.utils.remote import (
@@ -28,50 +23,6 @@
2823
)
2924

3025

31-
def extract_benchmark_tool_settings(benchmark_config):
32-
benchmark_tool = None
33-
benchmark_tool_source = None
34-
benchmark_tool_source_inner_path = None
35-
benchmark_min_tool_version = None
36-
benchmark_min_tool_version_major = None
37-
benchmark_min_tool_version_minor = None
38-
benchmark_min_tool_version_patch = None
39-
40-
for entry in benchmark_config["clientconfig"]:
41-
if "tool" in entry:
42-
benchmark_tool = entry["tool"]
43-
if "tool_source" in entry:
44-
for inner_entry in entry["tool_source"]:
45-
if "remote" in inner_entry:
46-
benchmark_tool_source = inner_entry["remote"]
47-
if "bin_path" in inner_entry:
48-
benchmark_tool_source_inner_path = inner_entry["bin_path"]
49-
50-
if "min-tool-version" in entry:
51-
benchmark_min_tool_version = entry["min-tool-version"]
52-
p = re.compile(r"(\d+)\.(\d+)\.(\d+)")
53-
m = p.match(benchmark_min_tool_version)
54-
if m is None:
55-
logging.error(
56-
"Unable to extract semversion from 'min-tool-version'."
57-
" Will not enforce version"
58-
)
59-
benchmark_min_tool_version = None
60-
else:
61-
benchmark_min_tool_version_major = m.group(1)
62-
benchmark_min_tool_version_minor = m.group(2)
63-
benchmark_min_tool_version_patch = m.group(3)
64-
return (
65-
benchmark_min_tool_version,
66-
benchmark_min_tool_version_major,
67-
benchmark_min_tool_version_minor,
68-
benchmark_min_tool_version_patch,
69-
benchmark_tool,
70-
benchmark_tool_source,
71-
benchmark_tool_source_inner_path,
72-
)
73-
74-
7526
def prepare_benchmark_parameters(
7627
benchmark_config,
7728
benchmark_tool,
@@ -183,85 +134,6 @@ def run_remote_benchmark(
183134
return remote_run_result
184135

185136

186-
def merge_default_and_specific_properties_dict_type(
187-
benchmark_config, default_properties, propertygroup_keyname, usecase_filename
188-
):
189-
if propertygroup_keyname not in benchmark_config:
190-
benchmark_config[propertygroup_keyname] = default_properties
191-
logging.info(
192-
"Using exclusively default '{}' properties (total={}) given the file {} had no '{}' property group".format(
193-
propertygroup_keyname,
194-
len(benchmark_config[propertygroup_keyname].keys()),
195-
usecase_filename,
196-
propertygroup_keyname,
197-
)
198-
)
199-
else:
200-
usecase_kpi = None
201-
use_case_specific_properties = benchmark_config[propertygroup_keyname]
202-
for default_property in default_properties:
203-
default_rule, default_details = list(default_property.items())[0]
204-
default_condition = list(default_details.values())[0]
205-
comparison_key = "{}{}".format(default_rule, default_condition)
206-
found = False
207-
for usecase_kpi in use_case_specific_properties:
208-
usecase_rule, usecase_details = list(usecase_kpi.items())[0]
209-
usecase_condition = list(usecase_details.values())[0]
210-
usecase_comparison_key = "{}{}".format(usecase_rule, usecase_condition)
211-
if comparison_key == usecase_comparison_key:
212-
found = True
213-
if found:
214-
logging.info(
215-
"Skipping to add default '{}' property ({}) given the file {}"
216-
" had the same specific property ({})".format(
217-
propertygroup_keyname,
218-
default_property,
219-
usecase_filename,
220-
usecase_kpi,
221-
)
222-
)
223-
else:
224-
use_case_specific_properties.append(default_property)
225-
logging.info(
226-
"Adding a default '{}' property ({}) given the file {} did not had the specific property".format(
227-
propertygroup_keyname, default_property, usecase_filename
228-
)
229-
)
230-
231-
232-
def process_default_yaml_properties_file(
233-
default_kpis, default_metrics, defaults_filename, exporter_timemetric_path, stream
234-
):
235-
default_config = yaml.safe_load(stream)
236-
if "exporter" in default_config:
237-
default_metrics = parse_exporter_metrics_definition(default_config["exporter"])
238-
if len(default_metrics) > 0:
239-
logging.info(
240-
"Found RedisTimeSeries default metrics specification."
241-
" Will include the following metrics on all benchmarks {}".format(
242-
" ".join(default_metrics)
243-
)
244-
)
245-
exporter_timemetric_path = parse_exporter_timemetric_definition(
246-
default_config["exporter"]
247-
)
248-
if exporter_timemetric_path is not None:
249-
logging.info(
250-
"Found RedisTimeSeries default time metric specification."
251-
" Will use the following JSON path to retrieve the test time {}".format(
252-
exporter_timemetric_path
253-
)
254-
)
255-
if "kpis" in default_config:
256-
logging.info(
257-
"Loading default KPIs specifications from file: {}".format(
258-
defaults_filename
259-
)
260-
)
261-
default_kpis = default_config["kpis"]
262-
return default_kpis, default_metrics, exporter_timemetric_path
263-
264-
265137
def common_exporter_logic(
266138
deployment_type,
267139
exporter_timemetric_path,

0 commit comments

Comments
 (0)