Skip to content

Commit b5256c8

Browse files
Metric for requests in progress. First custom prometheus metric
Signed-off-by: Mike Kingsbury <[email protected]>
1 parent f960c38 commit b5256c8

File tree

4 files changed

+206
-208
lines changed

4 files changed

+206
-208
lines changed

cachito/web/metrics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ def init_metrics(app):
3939
cachito_metrics["request_duration"] = request_duration
4040

4141

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

4646

47-
def requests_dec(state):
47+
def requests_dec(state: str) -> None:
4848
"""Decrease the number of requests in the given state."""
4949
cachito_metrics["gauge_state"].labels(state=state, host=hostname).dec()

requirements-test.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.10
2+
# This file is autogenerated by pip-compile with python 3.9
33
# To update, run:
44
#
55
# pip-compile --generate-hashes --output-file=requirements-test.txt requirements-test.in

0 commit comments

Comments
 (0)