redis-benchmarks-specification 0.1.326__py3-none-any.whl → 0.1.328__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.

Potentially problematic release.


This version of redis-benchmarks-specification might be problematic. Click here for more details.

@@ -89,6 +89,16 @@ def create_client_runner_args(project_name):
89
89
  default=".*",
90
90
  help="Filter tests by command using regex. Only tests that include commands matching this regex will be processed (e.g., 'bitcount|bitpos').",
91
91
  )
92
+ parser.add_argument(
93
+ "-u",
94
+ "--uri",
95
+ type=str,
96
+ default=None,
97
+ help="Server URI on format redis://user:password@host:port/dbnum. "
98
+ "User, password and dbnum are optional. For authentication "
99
+ "without a username, use username 'default'. For TLS, use "
100
+ "the scheme 'rediss'. If provided, overrides individual host/port/password arguments.",
101
+ )
92
102
  parser.add_argument("--db_server_host", type=str, default="localhost")
93
103
  parser.add_argument("--db_server_password", type=str, default=None)
94
104
  parser.add_argument("--db_server_port", type=int, default=6379)
@@ -12,6 +12,7 @@ import traceback
12
12
  from pathlib import Path
13
13
  import re
14
14
  import tqdm
15
+ from urllib.parse import urlparse
15
16
  import docker
16
17
  import redis
17
18
  from docker.models.containers import Container
@@ -90,6 +91,73 @@ def signal_handler(signum, frame):
90
91
  sys.exit(1)
91
92
 
92
93
 
94
+ def parse_redis_uri(uri):
95
+ """
96
+ Parse Redis URI and extract connection parameters.
97
+
98
+ Args:
99
+ uri (str): Redis URI in format redis://user:password@host:port/dbnum
100
+ or rediss://user:password@host:port/dbnum for TLS
101
+
102
+ Returns:
103
+ dict: Dictionary containing parsed connection parameters
104
+ """
105
+ if not uri:
106
+ return {}
107
+
108
+ try:
109
+ parsed = urlparse(uri)
110
+
111
+ # Extract connection parameters
112
+ params = {}
113
+
114
+ # Host (required)
115
+ if parsed.hostname:
116
+ params["host"] = parsed.hostname
117
+
118
+ # Port (optional, defaults to 6379)
119
+ if parsed.port:
120
+ params["port"] = parsed.port
121
+
122
+ # Username and password
123
+ if parsed.username:
124
+ params["username"] = parsed.username
125
+ if parsed.password:
126
+ params["password"] = parsed.password
127
+
128
+ # Database number
129
+ if parsed.path and len(parsed.path) > 1: # path starts with '/'
130
+ try:
131
+ params["db"] = int(parsed.path[1:]) # Remove leading '/'
132
+ except ValueError:
133
+ logging.warning(f"Invalid database number in URI: {parsed.path[1:]}")
134
+
135
+ # TLS detection
136
+ if parsed.scheme == "rediss":
137
+ params["tls_enabled"] = True
138
+ elif parsed.scheme == "redis":
139
+ params["tls_enabled"] = False
140
+ else:
141
+ logging.warning(
142
+ f"Unknown scheme in URI: {parsed.scheme}. Assuming non-TLS."
143
+ )
144
+ params["tls_enabled"] = False
145
+
146
+ logging.info(
147
+ f"Parsed Redis URI: host={params.get('host', 'N/A')}, "
148
+ f"port={params.get('port', 'N/A')}, "
149
+ f"username={params.get('username', 'N/A')}, "
150
+ f"db={params.get('db', 'N/A')}, "
151
+ f"tls={params.get('tls_enabled', False)}"
152
+ )
153
+
154
+ return params
155
+
156
+ except Exception as e:
157
+ logging.error(f"Failed to parse Redis URI '{uri}': {e}")
158
+ return {}
159
+
160
+
93
161
  def run_local_command_with_timeout(command_str, timeout_seconds, description="command"):
94
162
  """
95
163
  Run a local command with timeout support.
@@ -1443,35 +1511,80 @@ def process_self_contained_coordinator_stream(
1443
1511
  build_variant_name = "NA"
1444
1512
  git_branch = None
1445
1513
 
1446
- port = args.db_server_port
1447
- host = args.db_server_host
1514
+ # Parse URI if provided, otherwise use individual arguments
1515
+ if hasattr(args, "uri") and args.uri:
1516
+ uri_params = parse_redis_uri(args.uri)
1517
+ port = uri_params.get("port", args.db_server_port)
1518
+ host = uri_params.get("host", args.db_server_host)
1519
+ password = uri_params.get("password", args.db_server_password)
1520
+ # Override TLS setting from URI if specified
1521
+ if "tls_enabled" in uri_params:
1522
+ tls_enabled = uri_params["tls_enabled"]
1523
+ if tls_enabled:
1524
+ test_name = test_name + "-tls"
1525
+ logging.info(
1526
+ "TLS enabled via URI. Appending -tls to testname."
1527
+ )
1528
+ # Note: username and db are handled by redis-py automatically when using URI
1529
+ logging.info(
1530
+ f"Using connection parameters from URI: host={host}, port={port}, tls={tls_enabled}"
1531
+ )
1532
+ else:
1533
+ port = args.db_server_port
1534
+ host = args.db_server_host
1535
+ password = args.db_server_password
1536
+ logging.info(
1537
+ f"Using individual connection arguments: host={host}, port={port}"
1538
+ )
1539
+
1448
1540
  unix_socket = args.unix_socket
1449
- password = args.db_server_password
1450
1541
  oss_cluster_api_enabled = args.cluster_mode
1451
1542
  ssl_cert_reqs = "required"
1452
1543
  if tls_skip_verify:
1453
1544
  ssl_cert_reqs = None
1454
1545
 
1455
- # Build Redis connection parameters
1456
- redis_params = {
1457
- "host": host,
1458
- "port": port,
1459
- "password": password,
1460
- "ssl": tls_enabled,
1461
- "ssl_cert_reqs": ssl_cert_reqs,
1462
- "ssl_check_hostname": False,
1463
- }
1464
-
1465
- # Only add SSL certificate parameters if they are provided
1466
- if tls_enabled:
1467
- if tls_key is not None and tls_key != "":
1468
- redis_params["ssl_keyfile"] = tls_key
1469
- if tls_cert is not None and tls_cert != "":
1470
- redis_params["ssl_certfile"] = tls_cert
1471
- if tls_cacert is not None and tls_cacert != "":
1472
- redis_params["ssl_ca_certs"] = tls_cacert
1546
+ # Create Redis connection - use URI if provided, otherwise use individual parameters
1547
+ if hasattr(args, "uri") and args.uri:
1548
+ # Use URI connection (redis-py handles URI parsing automatically)
1549
+ redis_params = {}
1550
+
1551
+ # Only add SSL parameters if TLS is enabled
1552
+ if tls_enabled:
1553
+ redis_params["ssl_cert_reqs"] = ssl_cert_reqs
1554
+ redis_params["ssl_check_hostname"] = False
1555
+ if tls_key is not None and tls_key != "":
1556
+ redis_params["ssl_keyfile"] = tls_key
1557
+ if tls_cert is not None and tls_cert != "":
1558
+ redis_params["ssl_certfile"] = tls_cert
1559
+ if tls_cacert is not None and tls_cacert != "":
1560
+ redis_params["ssl_ca_certs"] = tls_cacert
1561
+
1562
+ r = redis.StrictRedis.from_url(args.uri, **redis_params)
1563
+ logging.info(f"Connected to Redis using URI: {args.uri}")
1564
+ else:
1565
+ # Use individual connection parameters
1566
+ redis_params = {
1567
+ "host": host,
1568
+ "port": port,
1569
+ "password": password,
1570
+ "ssl": tls_enabled,
1571
+ "ssl_cert_reqs": ssl_cert_reqs,
1572
+ "ssl_check_hostname": False,
1573
+ }
1574
+
1575
+ # Only add SSL certificate parameters if they are provided
1576
+ if tls_enabled:
1577
+ if tls_key is not None and tls_key != "":
1578
+ redis_params["ssl_keyfile"] = tls_key
1579
+ if tls_cert is not None and tls_cert != "":
1580
+ redis_params["ssl_certfile"] = tls_cert
1581
+ if tls_cacert is not None and tls_cacert != "":
1582
+ redis_params["ssl_ca_certs"] = tls_cacert
1473
1583
 
1474
- r = redis.StrictRedis(**redis_params)
1584
+ r = redis.StrictRedis(**redis_params)
1585
+ logging.info(
1586
+ f"Connected to Redis using individual parameters: {host}:{port}"
1587
+ )
1475
1588
  setup_name = "oss-standalone"
1476
1589
  r.ping()
1477
1590
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: redis-benchmarks-specification
3
- Version: 0.1.326
3
+ Version: 0.1.328
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
@@ -23,9 +23,9 @@ redis_benchmarks_specification/__compare__/args.py,sha256=CNtA7pI9CJDTBJPGL2pNVf
23
23
  redis_benchmarks_specification/__compare__/compare.py,sha256=_AbuV3FZxtUZIdq4qq24LNzPNIdtQQaqrk8bUjn9blk,84327
24
24
  redis_benchmarks_specification/__init__.py,sha256=YQIEx2sLPPA0JR9OuCuMNMNtm-f_gqDKgzvNJnkGNKY,491
25
25
  redis_benchmarks_specification/__runner__/__init__.py,sha256=l-G1z-t6twUgi8QLueqoTQLvJmv3hJoEYskGm6H7L6M,83
26
- redis_benchmarks_specification/__runner__/args.py,sha256=ZzebmTY5JushL-xKoDTkouj5N7um6KLk1aELSPCejcQ,10901
26
+ redis_benchmarks_specification/__runner__/args.py,sha256=K3VGmBC0-9lSv9H6VDp0N-6FGMWvc_4H0pG_TOXN5u8,11312
27
27
  redis_benchmarks_specification/__runner__/remote_profiling.py,sha256=R7obNQju8mmY9oKkcndjI4aAuxi84OCLhDSqqaYu1SU,18610
28
- redis_benchmarks_specification/__runner__/runner.py,sha256=ou7vWRBi1xdZtM1pLu_JEtZYrZ_yEaGrotXC087LhkU,146139
28
+ redis_benchmarks_specification/__runner__/runner.py,sha256=z_xGRVcsk7dJTMiA0YrUIJASO-E-zN2m7NcgGbVnN9c,150939
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
@@ -281,8 +281,8 @@ redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-session-st
281
281
  redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-session-storage-1k-sessions.yml,sha256=2egtIxPxCze2jlbAfgsk4v9JSQHNMoPLbDWFEW8olDg,7006
282
282
  redis_benchmarks_specification/test-suites/template.txt,sha256=ezqGiRPOvuSDO0iG7GEf-AGXNfHbgXI89_G0RUEzL88,481
283
283
  redis_benchmarks_specification/vector-search-test-suites/vector_db_benchmark_test.yml,sha256=PD7ow-k4Ll2BkhEC3aIqiaCZt8Hc4aJIp96Lw3J3mcI,791
284
- redis_benchmarks_specification-0.1.326.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
285
- redis_benchmarks_specification-0.1.326.dist-info/METADATA,sha256=v71OkfHY5rTi-T0nj57QVPgRhoFL1tnfU2607FY-nzE,22768
286
- redis_benchmarks_specification-0.1.326.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
287
- redis_benchmarks_specification-0.1.326.dist-info/entry_points.txt,sha256=x5WBXCZsnDRTZxV7SBGmC65L2k-ygdDOxV8vuKN00Nk,715
288
- redis_benchmarks_specification-0.1.326.dist-info/RECORD,,
284
+ redis_benchmarks_specification-0.1.328.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
285
+ redis_benchmarks_specification-0.1.328.dist-info/METADATA,sha256=ZczeKlE4rBkHFUAUCWSvmBzXLtYaA5s74c3rW-VnXZ8,22768
286
+ redis_benchmarks_specification-0.1.328.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
287
+ redis_benchmarks_specification-0.1.328.dist-info/entry_points.txt,sha256=x5WBXCZsnDRTZxV7SBGmC65L2k-ygdDOxV8vuKN00Nk,715
288
+ redis_benchmarks_specification-0.1.328.dist-info/RECORD,,