Download counter metrics

This commit is contained in:
Csaba 2024-02-19 10:01:38 +01:00
parent 6754c76c05
commit 0f1441163a
2 changed files with 10 additions and 1 deletions

View file

@ -21,6 +21,15 @@ logger = logging.getLogger(__name__)
security = HTTPBasic() security = HTTPBasic()
gtfs_download_counter = Counter("gtfs_downloads", "How many times GTFS data was downloaded")
grfs_download_counter = Counter("grfs_downloads", "How many times GRFS data was downloaded")
def increment_gtfs_download_counter():
gtfs_download_counter.inc()
def increment_grfs_download_counter():
grfs_download_counter.inc()
def amarillo_trips_number_total() -> Callable[[Info], None]: def amarillo_trips_number_total() -> Callable[[Info], None]:
METRIC = Gauge("amarillo_trips_number_total", "Total number of trips.") METRIC = Gauge("amarillo_trips_number_total", "Total number of trips.")

View file

@ -1,6 +1,6 @@
[project] [project]
name = "amarillo-metrics" name = "amarillo-metrics"
version = "0.0.5" version = "0.0.6"
description = "Prometheus metrics for Amarillo" description = "Prometheus metrics for Amarillo"
readme = "README.md" readme = "README.md"
license = {file = "LICENSE"} license = {file = "LICENSE"}