Skip to content

[add] Introduce health_check_interval, socket_connect_timeout, and socket_keepalive settings to Redis connections #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "redis-benchmarks-specification"
version = "0.1.9"
version = "0.1.10"
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."
authors = ["filipecosta90 <filipecosta.90@gmail.com>"]
readme = "Readme.md"
Expand Down
5 changes: 5 additions & 0 deletions redis_benchmarks_specification/__api__/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
LOG_FORMAT,
LOG_DATEFMT,
LOG_LEVEL,
REDIS_HEALTH_CHECK_INTERVAL,
REDIS_SOCKET_TIMEOUT,
)
from redis_benchmarks_specification.__common__.package import (
populate_with_poetry_data,
Expand Down Expand Up @@ -55,6 +57,9 @@ def main():
port=GH_REDIS_SERVER_PORT,
decode_responses=True,
password=GH_REDIS_SERVER_AUTH,
health_check_interval=REDIS_HEALTH_CHECK_INTERVAL,
socket_connect_timeout=REDIS_SOCKET_TIMEOUT,
socket_keepalive=True,
)
app = create_app(conn)
if args.logname is not None:
Expand Down
5 changes: 5 additions & 0 deletions redis_benchmarks_specification/__builder__/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
SPECS_PATH_SETUPS,
STREAM_GH_EVENTS_COMMIT_BUILDERS_CG,
STREAM_KEYNAME_NEW_BUILD_EVENTS,
REDIS_HEALTH_CHECK_INTERVAL,
REDIS_SOCKET_TIMEOUT,
)
from redis_benchmarks_specification.__common__.package import (
populate_with_poetry_data,
Expand Down Expand Up @@ -103,6 +105,9 @@ def main():
port=GH_REDIS_SERVER_PORT,
decode_responses=False, # dont decode due to zip archive
password=GH_REDIS_SERVER_AUTH,
health_check_interval=REDIS_HEALTH_CHECK_INTERVAL,
socket_connect_timeout=REDIS_SOCKET_TIMEOUT,
socket_keepalive=True,
)
conn.ping()
except redis.exceptions.ConnectionError as e:
Expand Down
2 changes: 2 additions & 0 deletions redis_benchmarks_specification/__common__/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
# DB used to authenticate ( read-only/non-dangerous access only )
REDIS_AUTH_SERVER_HOST = os.getenv("REDIS_AUTH_SERVER_HOST", "localhost")
REDIS_AUTH_SERVER_PORT = int(os.getenv("REDIS_AUTH_SERVER_PORT", "6380"))
REDIS_HEALTH_CHECK_INTERVAL = int(os.getenv("REDIS_HEALTH_CHECK_INTERVAL", "15"))
REDIS_SOCKET_TIMEOUT = int(os.getenv("REDIS_SOCKET_TIMEOUT", "300"))

# environment variables
DATASINK_RTS_PUSH = bool(os.getenv("DATASINK_PUSH_RTS", False))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
STREAM_KEYNAME_NEW_BUILD_EVENTS,
GH_REDIS_SERVER_USER,
STREAM_GH_NEW_BUILD_RUNNERS_CG,
REDIS_HEALTH_CHECK_INTERVAL,
REDIS_SOCKET_TIMEOUT,
)
from redis_benchmarks_specification.__common__.package import (
get_version_string,
Expand Down Expand Up @@ -108,6 +110,9 @@ def main():
decode_responses=False, # dont decode due to binary archives
password=GH_REDIS_SERVER_AUTH,
username=GH_REDIS_SERVER_USER,
health_check_interval=REDIS_HEALTH_CHECK_INTERVAL,
socket_connect_timeout=REDIS_SOCKET_TIMEOUT,
socket_keepalive=True,
)
conn.ping()
except redis.exceptions.ConnectionError as e:
Expand All @@ -132,6 +137,9 @@ def main():
decode_responses=True,
password=args.datasink_redistimeseries_pass,
username=args.datasink_redistimeseries_user,
health_check_interval=REDIS_HEALTH_CHECK_INTERVAL,
socket_connect_timeout=REDIS_SOCKET_TIMEOUT,
socket_keepalive=True,
)
rts.redis.ping()
except redis.exceptions.ConnectionError as e:
Expand Down