redis-benchmarks-specification 0.1.299__py3-none-any.whl → 0.1.301__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,13 +3,13 @@ import logging
3
3
  import os
4
4
  import pathlib
5
5
  import re
6
-
6
+ import datetime as dt
7
7
  import redis
8
- from redisbench_admin.run.metrics import collect_redis_metrics
9
- from redisbench_admin.run_remote.run_remote import export_redis_metrics
10
8
 
11
9
  from redis_benchmarks_specification.__common__.timeseries import (
12
10
  timeseries_test_sucess_flow,
11
+ push_data_to_redistimeseries,
12
+ get_project_ts_tags,
13
13
  )
14
14
 
15
15
 
@@ -119,6 +119,210 @@ def extract_testsuites(args):
119
119
  return testsuite_spec_files
120
120
 
121
121
 
122
+
123
+ def commandstats_latencystats_process_name(
124
+ metric_name, prefix, setup_name, variant_labels_dict
125
+ ):
126
+ if prefix in metric_name:
127
+ command_and_metric_and_shard = metric_name[len(prefix) :]
128
+ command = (
129
+ command_and_metric_and_shard[0]
130
+ + command_and_metric_and_shard[1:].split("_", 1)[0]
131
+ )
132
+ metric_and_shard = command_and_metric_and_shard[1:].split("_", 1)[1]
133
+ metric = metric_and_shard
134
+ shard = "1"
135
+ if "_shard_" in metric_and_shard:
136
+ metric = metric_and_shard.split("_shard_")[0]
137
+ shard = metric_and_shard.split("_shard_")[1]
138
+ variant_labels_dict["metric"] = metric
139
+ variant_labels_dict["command"] = command
140
+ variant_labels_dict["command_and_metric"] = "{} - {}".format(command, metric)
141
+ variant_labels_dict["command_and_metric_and_setup"] = "{} - {} - {}".format(
142
+ command, metric, setup_name
143
+ )
144
+ variant_labels_dict["command_and_setup"] = "{} - {}".format(command, setup_name)
145
+ variant_labels_dict["shard"] = shard
146
+ variant_labels_dict["metric_and_shard"] = metric_and_shard
147
+
148
+ version = None
149
+ branch = None
150
+ if "version" in variant_labels_dict:
151
+ version = variant_labels_dict["version"]
152
+ if "branch" in variant_labels_dict:
153
+ branch = variant_labels_dict["branch"]
154
+
155
+ if version is not None:
156
+ variant_labels_dict["command_and_metric_and_version"] = (
157
+ "{} - {} - {}".format(command, metric, version)
158
+ )
159
+ variant_labels_dict["command_and_metric_and_setup_and_version"] = (
160
+ "{} - {} - {} - {}".format(command, metric, setup_name, version)
161
+ )
162
+
163
+ if branch is not None:
164
+ variant_labels_dict["command_and_metric_and_branch"] = (
165
+ "{} - {} - {}".format(command, metric, branch)
166
+ )
167
+ variant_labels_dict["command_and_metric_and_setup_and_branch"] = (
168
+ "{} - {} - {} - {}".format(command, metric, setup_name, branch)
169
+ )
170
+
171
+
172
+ def collect_redis_metrics(
173
+ redis_conns,
174
+ sections=["memory", "cpu", "commandstats", "latencystats"],
175
+ section_filter=None,
176
+ ):
177
+ start_time = dt.datetime.utcnow()
178
+ start_time_ms = int((start_time - dt.datetime(1970, 1, 1)).total_seconds() * 1000)
179
+ res = []
180
+ overall = {}
181
+ multi_shard = False
182
+ if len(redis_conns) > 1:
183
+ multi_shard = True
184
+ for conn_n, conn in enumerate(redis_conns):
185
+ conn_res = {}
186
+ for section in sections:
187
+ info = conn.info(section)
188
+ conn_res[section] = info
189
+ if section not in overall:
190
+ overall[section] = {}
191
+ for k, v in info.items():
192
+ collect = True
193
+ if section_filter is not None:
194
+ if section in section_filter:
195
+ if k not in section_filter[section]:
196
+ collect = False
197
+ if collect and type(v) is float or type(v) is int:
198
+ if k not in overall[section]:
199
+ overall[section][k] = 0
200
+ overall[section][k] += v
201
+ if collect and type(v) is dict:
202
+ for inner_k, inner_v in v.items():
203
+ if type(inner_v) is float or type(inner_v) is int:
204
+ final_str_k = "{}_{}".format(k, inner_k)
205
+ if multi_shard:
206
+ final_str_k += "_shard_{}".format(conn_n + 1)
207
+ if final_str_k not in overall[section]:
208
+ overall[section][final_str_k] = inner_v
209
+
210
+ res.append(conn_res)
211
+
212
+ kv_overall = {}
213
+ for sec, kv_detail in overall.items():
214
+ for k, metric_value in kv_detail.items():
215
+ metric_name = "{}_{}".format(sec, k)
216
+ kv_overall[metric_name] = metric_value
217
+
218
+ return start_time_ms, res, kv_overall
219
+
220
+ def export_redis_metrics(
221
+ artifact_version,
222
+ end_time_ms,
223
+ overall_end_time_metrics,
224
+ rts,
225
+ setup_name,
226
+ setup_type,
227
+ test_name,
228
+ tf_github_branch,
229
+ tf_github_org,
230
+ tf_github_repo,
231
+ tf_triggering_env,
232
+ metadata_dict=None,
233
+ expire_ms=0,
234
+ git_hash=None,
235
+ running_platform=None,
236
+ ):
237
+ datapoint_errors = 0
238
+ datapoint_inserts = 0
239
+ sprefix = (
240
+ "ci.benchmarks.redis/"
241
+ + "{triggering_env}/{github_org}/{github_repo}".format(
242
+ triggering_env=tf_triggering_env,
243
+ github_org=tf_github_org,
244
+ github_repo=tf_github_repo,
245
+ )
246
+ )
247
+ logging.info(
248
+ "Adding a total of {} server side metrics collected at the end of benchmark".format(
249
+ len(list(overall_end_time_metrics.items()))
250
+ )
251
+ )
252
+ timeseries_dict = {}
253
+ by_variants = {}
254
+ if tf_github_branch is not None and tf_github_branch != "":
255
+ by_variants["by.branch/{}".format(tf_github_branch)] = {
256
+ "branch": tf_github_branch
257
+ }
258
+ if git_hash is not None and git_hash != "":
259
+ by_variants["by.hash/{}".format(git_hash)] = {
260
+ "hash": git_hash
261
+ }
262
+ if artifact_version is not None and artifact_version != "":
263
+ by_variants["by.version/{}".format(artifact_version)] = {
264
+ "version": artifact_version
265
+ }
266
+ for (
267
+ by_variant,
268
+ variant_labels_dict,
269
+ ) in by_variants.items():
270
+ for (
271
+ metric_name,
272
+ metric_value,
273
+ ) in overall_end_time_metrics.items():
274
+ tsname_metric = "{}/{}/{}/benchmark_end/{}/{}".format(
275
+ sprefix,
276
+ test_name,
277
+ by_variant,
278
+ setup_name,
279
+ metric_name,
280
+ )
281
+
282
+ logging.debug(
283
+ "Adding a redis server side metric collected at the end of benchmark."
284
+ + " metric_name={} metric_value={} time-series name: {}".format(
285
+ metric_name,
286
+ metric_value,
287
+ tsname_metric,
288
+ )
289
+ )
290
+ variant_labels_dict["metric"] = metric_name
291
+ commandstats_latencystats_process_name(
292
+ metric_name, "commandstats_cmdstat_", setup_name, variant_labels_dict
293
+ )
294
+ commandstats_latencystats_process_name(
295
+ metric_name,
296
+ "latencystats_latency_percentiles_usec_",
297
+ setup_name,
298
+ variant_labels_dict,
299
+ )
300
+
301
+ variant_labels_dict["test_name"] = test_name
302
+ if metadata_dict is not None:
303
+ variant_labels_dict.update(metadata_dict)
304
+
305
+ timeseries_dict[tsname_metric] = {
306
+ "labels": get_project_ts_tags(
307
+ tf_github_org,
308
+ tf_github_repo,
309
+ setup_name,
310
+ setup_type,
311
+ tf_triggering_env,
312
+ variant_labels_dict,
313
+ None,
314
+ running_platform,
315
+ ),
316
+ "data": {end_time_ms: metric_value},
317
+ }
318
+ i_errors, i_inserts = push_data_to_redistimeseries(rts, timeseries_dict, expire_ms)
319
+ datapoint_errors = datapoint_errors + i_errors
320
+ datapoint_inserts = datapoint_inserts + i_inserts
321
+ return datapoint_errors, datapoint_inserts
322
+
323
+
324
+
325
+
122
326
  def reset_commandstats(redis_conns):
123
327
  for pos, redis_conn in enumerate(redis_conns):
124
328
  logging.info("Resetting commmandstats for shard {}".format(pos))
@@ -28,7 +28,10 @@ from redisbench_admin.run.common import (
28
28
  prepare_benchmark_parameters,
29
29
  dbconfig_keyspacelen_check,
30
30
  )
31
- from redisbench_admin.run_remote.run_remote import export_redis_metrics
31
+
32
+ from redis_benchmarks_specification.__common__.runner import (
33
+ export_redis_metrics,
34
+ )
32
35
 
33
36
  from redisbench_admin.run.metrics import extract_results_table
34
37
  from redisbench_admin.run.run import calculate_client_tool_duration_and_check
@@ -56,6 +59,7 @@ from redis_benchmarks_specification.__common__.runner import (
56
59
  exporter_datasink_common,
57
60
  reset_commandstats,
58
61
  execute_init_commands,
62
+ export_redis_metrics,
59
63
  )
60
64
  from redis_benchmarks_specification.__common__.spec import (
61
65
  extract_client_container_image,
@@ -1935,8 +1939,10 @@ def process_self_contained_coordinator_stream(
1935
1939
  tf_github_org,
1936
1940
  tf_github_repo,
1937
1941
  tf_triggering_env,
1938
- {"metric-type": "memory-stats"},
1942
+ metadata,
1939
1943
  expire_redis_metrics_ms,
1944
+ git_hash,
1945
+ running_platform,
1940
1946
  )
1941
1947
 
1942
1948
  exporter_datasink_common(
@@ -1962,8 +1968,8 @@ def process_self_contained_coordinator_stream(
1962
1968
  topology_spec_name,
1963
1969
  default_metrics,
1964
1970
  git_hash,
1965
- collect_commandstats=False,
1966
- collect_memory_metrics=True,
1971
+ False,
1972
+ True,
1967
1973
  )
1968
1974
 
1969
1975
  # Send MEMORY PURGE after memory comparison (if FLUSHALL at test end is not enabled)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: redis-benchmarks-specification
3
- Version: 0.1.299
3
+ Version: 0.1.301
4
4
  Summary: The Redis benchmarks specification describes the cross-language/tools requirements and expectations to foster performance and observability standards around redis related technologies. Members from both industry and academia, including organizations and individuals are encouraged to contribute.
5
5
  Author: filipecosta90
6
6
  Author-email: filipecosta.90@gmail.com
@@ -15,7 +15,7 @@ redis_benchmarks_specification/__common__/builder_schema.py,sha256=kfDpRIk7NkJrb
15
15
  redis_benchmarks_specification/__common__/env.py,sha256=kvJ8Ll-fvI_Tc0vynrzUEr22TqnJizzvJ4Lu9RjNr_M,3119
16
16
  redis_benchmarks_specification/__common__/github.py,sha256=9TZtnISsSgXTSAN_VQejo5YRPDPhlU0gjxgKGPw_sP8,10699
17
17
  redis_benchmarks_specification/__common__/package.py,sha256=4uVt1BAZ999LV2rZkq--Tk6otAVIf9YR3g3KGeUpiW4,834
18
- redis_benchmarks_specification/__common__/runner.py,sha256=3eZ3GUKfWMUbvNhoryRnbennqPVRqzQ9189-B9N2YdE,8314
18
+ redis_benchmarks_specification/__common__/runner.py,sha256=s5IJnxO527SoImhQmOU2UrqR4_h3MnHM2i7dh7wNV1Y,15649
19
19
  redis_benchmarks_specification/__common__/spec.py,sha256=D_SN48wg6NMthW_-OS1H5bydSDiuZpfd4WPPj7Vfwmc,5760
20
20
  redis_benchmarks_specification/__common__/timeseries.py,sha256=w8XQrGPEFuuemDXXz4iny7lYsNbYH0ycQyq3jHIr80g,52916
21
21
  redis_benchmarks_specification/__compare__/__init__.py,sha256=DtBXRp0Q01XgCFmY-1OIePMyyYihVNAjZ1Y8zwqSDN0,101
@@ -25,7 +25,7 @@ redis_benchmarks_specification/__init__.py,sha256=YQIEx2sLPPA0JR9OuCuMNMNtm-f_gq
25
25
  redis_benchmarks_specification/__runner__/__init__.py,sha256=l-G1z-t6twUgi8QLueqoTQLvJmv3hJoEYskGm6H7L6M,83
26
26
  redis_benchmarks_specification/__runner__/args.py,sha256=YeN7-eOGoqCHKh5FrKz9z5Ee-Rh-3DF9tm2Hb-3m7sQ,10648
27
27
  redis_benchmarks_specification/__runner__/remote_profiling.py,sha256=JS46mFxnRB2HSU_HO90WE4w7P7usHzX1dwZg1bJpTMc,18588
28
- redis_benchmarks_specification/__runner__/runner.py,sha256=ULuDKCiXk5BCk_I3lyDkggBNq_xmfk47n5poQCeT3yQ,137882
28
+ redis_benchmarks_specification/__runner__/runner.py,sha256=pHgPkZktwlsIrvYaGais0SAvkH5olDeTDO4R5kdxudU,137953
29
29
  redis_benchmarks_specification/__self_contained_coordinator__/__init__.py,sha256=l-G1z-t6twUgi8QLueqoTQLvJmv3hJoEYskGm6H7L6M,83
30
30
  redis_benchmarks_specification/__self_contained_coordinator__/args.py,sha256=uxBjdQ78klvsVi6lOfGYQVaWIxc8OI-DwYKY16SgvCY,5952
31
31
  redis_benchmarks_specification/__self_contained_coordinator__/artifacts.py,sha256=OVHqJzDgeSSRfUSiKp1ZTAVv14PvSbk-5yJsAAoUfpw,936
@@ -273,8 +273,8 @@ redis_benchmarks_specification/test-suites/memtier_benchmark-nokeys-pubsub-publi
273
273
  redis_benchmarks_specification/test-suites/memtier_benchmark-nokeys-server-time-pipeline-10.yml,sha256=7G_J8kUFay7jXhZvsZK5jvVHSLZvhMV0uuDMkZBbeSQ,675
274
274
  redis_benchmarks_specification/test-suites/template.txt,sha256=d_edIE7Sxa5X7I2yG-Io0bPdbDIHR0oWFoCA3XUt_EU,435
275
275
  redis_benchmarks_specification/vector-search-test-suites/vector_db_benchmark_test.yml,sha256=PD7ow-k4Ll2BkhEC3aIqiaCZt8Hc4aJIp96Lw3J3mcI,791
276
- redis_benchmarks_specification-0.1.299.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
277
- redis_benchmarks_specification-0.1.299.dist-info/METADATA,sha256=xs8UTp9pDMtka8HrMqorK1nMtwEeQxptBkB2EviqG-A,22726
278
- redis_benchmarks_specification-0.1.299.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
279
- redis_benchmarks_specification-0.1.299.dist-info/entry_points.txt,sha256=x5WBXCZsnDRTZxV7SBGmC65L2k-ygdDOxV8vuKN00Nk,715
280
- redis_benchmarks_specification-0.1.299.dist-info/RECORD,,
276
+ redis_benchmarks_specification-0.1.301.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
277
+ redis_benchmarks_specification-0.1.301.dist-info/METADATA,sha256=C3ytp_y6zvhWnBn06yKTK1XZgSySycj3i9IJU5Ry9q8,22726
278
+ redis_benchmarks_specification-0.1.301.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
279
+ redis_benchmarks_specification-0.1.301.dist-info/entry_points.txt,sha256=x5WBXCZsnDRTZxV7SBGmC65L2k-ygdDOxV8vuKN00Nk,715
280
+ redis_benchmarks_specification-0.1.301.dist-info/RECORD,,