Skip to content

Commit e2d3bdf

Browse files
[add] Introduce health_check_interval, socket_connect_timeout, and socket_keepalive settings to Redis connections (#40)
* [add] Introduce health_check_interval, socket_connect_timeout, and socket_keepalive settings to Redis connections * [ver] Bumping version from 0.1.9 to 0.1.10
1 parent 8843cb3 commit e2d3bdf

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

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 = "redis-benchmarks-specification"
3-
version = "0.1.9"
3+
version = "0.1.10"
44
description = "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."
55
authors = ["filipecosta90 <[email protected]>"]
66
readme = "Readme.md"

redis_benchmarks_specification/__api__/api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
LOG_FORMAT,
2121
LOG_DATEFMT,
2222
LOG_LEVEL,
23+
REDIS_HEALTH_CHECK_INTERVAL,
24+
REDIS_SOCKET_TIMEOUT,
2325
)
2426
from redis_benchmarks_specification.__common__.package import (
2527
populate_with_poetry_data,
@@ -55,6 +57,9 @@ def main():
5557
port=GH_REDIS_SERVER_PORT,
5658
decode_responses=True,
5759
password=GH_REDIS_SERVER_AUTH,
60+
health_check_interval=REDIS_HEALTH_CHECK_INTERVAL,
61+
socket_connect_timeout=REDIS_SOCKET_TIMEOUT,
62+
socket_keepalive=True,
5863
)
5964
app = create_app(conn)
6065
if args.logname is not None:

redis_benchmarks_specification/__builder__/builder.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
SPECS_PATH_SETUPS,
2525
STREAM_GH_EVENTS_COMMIT_BUILDERS_CG,
2626
STREAM_KEYNAME_NEW_BUILD_EVENTS,
27+
REDIS_HEALTH_CHECK_INTERVAL,
28+
REDIS_SOCKET_TIMEOUT,
2729
)
2830
from redis_benchmarks_specification.__common__.package import (
2931
populate_with_poetry_data,
@@ -103,6 +105,9 @@ def main():
103105
port=GH_REDIS_SERVER_PORT,
104106
decode_responses=False, # dont decode due to zip archive
105107
password=GH_REDIS_SERVER_AUTH,
108+
health_check_interval=REDIS_HEALTH_CHECK_INTERVAL,
109+
socket_connect_timeout=REDIS_SOCKET_TIMEOUT,
110+
socket_keepalive=True,
106111
)
107112
conn.ping()
108113
except redis.exceptions.ConnectionError as e:

redis_benchmarks_specification/__common__/env.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
# DB used to authenticate ( read-only/non-dangerous access only )
4747
REDIS_AUTH_SERVER_HOST = os.getenv("REDIS_AUTH_SERVER_HOST", "localhost")
4848
REDIS_AUTH_SERVER_PORT = int(os.getenv("REDIS_AUTH_SERVER_PORT", "6380"))
49+
REDIS_HEALTH_CHECK_INTERVAL = int(os.getenv("REDIS_HEALTH_CHECK_INTERVAL", "15"))
50+
REDIS_SOCKET_TIMEOUT = int(os.getenv("REDIS_SOCKET_TIMEOUT", "300"))
4951

5052
# environment variables
5153
DATASINK_RTS_PUSH = bool(os.getenv("DATASINK_PUSH_RTS", False))

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
STREAM_KEYNAME_NEW_BUILD_EVENTS,
3838
GH_REDIS_SERVER_USER,
3939
STREAM_GH_NEW_BUILD_RUNNERS_CG,
40+
REDIS_HEALTH_CHECK_INTERVAL,
41+
REDIS_SOCKET_TIMEOUT,
4042
)
4143
from redis_benchmarks_specification.__common__.package import (
4244
get_version_string,
@@ -108,6 +110,9 @@ def main():
108110
decode_responses=False, # dont decode due to binary archives
109111
password=GH_REDIS_SERVER_AUTH,
110112
username=GH_REDIS_SERVER_USER,
113+
health_check_interval=REDIS_HEALTH_CHECK_INTERVAL,
114+
socket_connect_timeout=REDIS_SOCKET_TIMEOUT,
115+
socket_keepalive=True,
111116
)
112117
conn.ping()
113118
except redis.exceptions.ConnectionError as e:
@@ -132,6 +137,9 @@ def main():
132137
decode_responses=True,
133138
password=args.datasink_redistimeseries_pass,
134139
username=args.datasink_redistimeseries_user,
140+
health_check_interval=REDIS_HEALTH_CHECK_INTERVAL,
141+
socket_connect_timeout=REDIS_SOCKET_TIMEOUT,
142+
socket_keepalive=True,
135143
)
136144
rts.redis.ping()
137145
except redis.exceptions.ConnectionError as e:

0 commit comments

Comments
 (0)