Skip to content

Added API healthcheck endpoints #123

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 7 commits into from
Oct 10, 2022
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.50"
version = "0.1.53"
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>","Redis Performance Group <performance@redis.com>"]
readme = "Readme.md"
Expand Down
4 changes: 3 additions & 1 deletion redis_benchmarks_specification/__api__/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def main():
parser.add_argument(
"--logname", type=str, default=None, help="logname to write the logs to"
)
parser.add_argument("--port", type=int, default=5000, help="port")
args = parser.parse_args()
print(
"Using redis available at: {}:{} for event store.".format(
Expand Down Expand Up @@ -78,7 +79,8 @@ def main():
GH_REDIS_SERVER_HOST, GH_REDIS_SERVER_PORT
)
)
app.run(host="0.0.0.0")
logging.info("Listening on port {}".format(args.port))
app.run(host="0.0.0.0", port=args.port)


if __name__ == "__main__":
Expand Down
17 changes: 17 additions & 0 deletions redis_benchmarks_specification/__api__/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ def verify_signature(req):
pass
return result

@app.route("/ping", methods=["GET"])
def ping():
return "PONG", 200

# verify deps
@app.route("/pong", methods=["GET"])
def pong():
code = 200
try:
conn.ping()
redis_status = "OK"
except Exception as e:
redis_status = e.__str__()
code = 503
res = {"redis": {"status": redis_status}}
return jsonify(res), code

@app.route("/api/gh/redis/redis/commits", methods=["POST"])
def base():
if verify_signature(request):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

from redisbench_admin.profilers.profilers_local import (
check_compatible_system_and_kernel_and_prepare_profile,
profilers_stop_if_required,
)
from redisbench_admin.run.grafana import generate_artifacts_table_grafana_redis

from redis_benchmarks_specification.__common__.env import (
LOG_FORMAT,
Expand Down