Skip to content

Commit

Permalink
Metric for requests in progress. First custom prometheus metric
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Kingsbury <[email protected]>
  • Loading branch information
mike-kingsbury committed Nov 15, 2022
1 parent f960c38 commit b5256c8
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 208 deletions.
4 changes: 2 additions & 2 deletions cachito/web/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def init_metrics(app):
cachito_metrics["request_duration"] = request_duration


def requests_inc(state):
def requests_inc(state: str) -> None:
"""Increase the number of requests in given state."""
cachito_metrics["gauge_state"].labels(state=state, host=hostname).inc()


def requests_dec(state):
def requests_dec(state: str) -> None:
"""Decrease the number of requests in the given state."""
cachito_metrics["gauge_state"].labels(state=state, host=hostname).dec()
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.10
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile --generate-hashes --output-file=requirements-test.txt requirements-test.in
Expand Down
Loading

0 comments on commit b5256c8

Please sign in to comment.