Skip to content

Commit 0e50b6b

Browse files
[fix] Fixed memtier exporter docs. When TS not present use current system time on redisbench-admin export (#222)
1 parent d00ac68 commit 0e50b6b

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

docs/export.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ An exporter definition will then consist of:
104104

105105
Bellow you can find a sample exporter definition for `memtier_benchmark`.
106106

107-
## Sample exporter definition for memtier_benchmark:
107+
## Sample exporter definition for memtier_benchmark > v1.3.0:
108108
```yml
109109
version: 0.5
110110
exporter:
@@ -120,6 +120,16 @@ exporter:
120120
- "$.'ALL STATS'.Totals.'Max Latency'"
121121
```
122122
123+
## Sample exporter definition for memtier_benchmark <= v1.3.0:
124+
```yml
125+
version: 0.5
126+
exporter:
127+
redistimeseries:
128+
timemetric: "$.'ALL STATS'.Runtime.'Start time'"
129+
metrics:
130+
- "$.'BEST RUN RESULTS'.Totals.'Ops/sec'"
131+
```
132+
123133
# Exporting results
124134
125135
## Exporting memtier_benchmark results

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.5.6"
3+
version = "0.5.7"
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]>","Redis Performance Group <[email protected]>"]
66
readme = "README.md"

redisbench_admin/export/export.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import json
99
import logging
10+
import datetime
1011

1112
import redis
1213
from redistimeseries.client import Client
@@ -76,6 +77,15 @@ def export_command_logic(args, project_name, project_version):
7677
datapoints_timestamp = parse_exporter_timemetric(
7778
exporter_timemetric_path, results_dict
7879
)
80+
if datapoints_timestamp is None:
81+
datapoints_timestamp = int(
82+
datetime.datetime.now(datetime.timezone.utc).timestamp() * 1000.0
83+
)
84+
logging.warning(
85+
"Error while trying to parse datapoints timestamp. Using current system timestamp Error: {}".format(
86+
datapoints_timestamp
87+
)
88+
)
7989

8090
timeseries_test_sucess_flow(
8191
True,

redisbench_admin/run/common.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,18 @@ def common_exporter_logic(
224224
metadata_tags={},
225225
build_variant_name=None,
226226
running_platform=None,
227+
datapoints_timestamp=None,
227228
):
228229
per_version_time_series_dict = None
229230
per_branch_time_series_dict = None
230231
testcase_metric_context_paths = []
231232

232233
if exporter_timemetric_path is not None and len(metrics) > 0:
233-
# extract timestamp
234-
datapoints_timestamp = parse_exporter_timemetric(
235-
exporter_timemetric_path, results_dict
236-
)
234+
if datapoints_timestamp is None:
235+
# extract timestamp
236+
datapoints_timestamp = parse_exporter_timemetric(
237+
exporter_timemetric_path, results_dict
238+
)
237239
if (
238240
artifact_version is not None
239241
and artifact_version != ""

redisbench_admin/run/redistimeseries.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def redistimeseries_results_logic(
3838
metadata_tags={},
3939
build_variant_name=None,
4040
running_platform=None,
41+
datapoints_timestamp=None,
4142
):
4243
# check which metrics to extract
4344
exporter_timemetric_path, metrics = merge_default_and_config_metrics(
@@ -63,6 +64,7 @@ def redistimeseries_results_logic(
6364
metadata_tags,
6465
build_variant_name,
6566
running_platform,
67+
datapoints_timestamp,
6668
)
6769
return (
6870
per_version_time_series_dict,
@@ -250,6 +252,7 @@ def timeseries_test_sucess_flow(
250252
metadata_tags,
251253
build_variant_name,
252254
running_platform,
255+
start_time_ms,
253256
)
254257
(
255258
_,

0 commit comments

Comments
 (0)