Skip to content

Commit 42c89e9

Browse files
Added API healthcheck endpoints (#123)
* Added --docker-air-gap to builder and scc * Add last_n to cli trigger tool * Fixed circular dependency on scc * Fixed self contained coordinator circular dependency import * Added API healthcheck endpoints
1 parent 7e0eea2 commit 42c89e9

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
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.50"
3+
version = "0.1.53"
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 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
66
readme = "Readme.md"

redis_benchmarks_specification/__api__/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def main():
4040
parser.add_argument(
4141
"--logname", type=str, default=None, help="logname to write the logs to"
4242
)
43+
parser.add_argument("--port", type=int, default=5000, help="port")
4344
args = parser.parse_args()
4445
print(
4546
"Using redis available at: {}:{} for event store.".format(
@@ -78,7 +79,8 @@ def main():
7879
GH_REDIS_SERVER_HOST, GH_REDIS_SERVER_PORT
7980
)
8081
)
81-
app.run(host="0.0.0.0")
82+
logging.info("Listening on port {}".format(args.port))
83+
app.run(host="0.0.0.0", port=args.port)
8284

8385

8486
if __name__ == "__main__":

redis_benchmarks_specification/__api__/app.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,23 @@ def verify_signature(req):
4949
pass
5050
return result
5151

52+
@app.route("/ping", methods=["GET"])
53+
def ping():
54+
return "PONG", 200
55+
56+
# verify deps
57+
@app.route("/pong", methods=["GET"])
58+
def pong():
59+
code = 200
60+
try:
61+
conn.ping()
62+
redis_status = "OK"
63+
except Exception as e:
64+
redis_status = e.__str__()
65+
code = 503
66+
res = {"redis": {"status": redis_status}}
67+
return jsonify(res), code
68+
5269
@app.route("/api/gh/redis/redis/commits", methods=["POST"])
5370
def base():
5471
if verify_signature(request):

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

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

88
from redisbench_admin.profilers.profilers_local import (
99
check_compatible_system_and_kernel_and_prepare_profile,
10+
profilers_stop_if_required,
1011
)
12+
from redisbench_admin.run.grafana import generate_artifacts_table_grafana_redis
1113

1214
from redis_benchmarks_specification.__common__.env import (
1315
LOG_FORMAT,

0 commit comments

Comments
 (0)