From e0f9abf4caa7061b018440ea670e3b9c7230ed61 Mon Sep 17 00:00:00 2001 From: Francia Csaba Date: Mon, 19 Feb 2024 11:12:28 +0100 Subject: [PATCH] Added CRUD metrics --- amarillo/plugins/metrics/metrics.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/amarillo/plugins/metrics/metrics.py b/amarillo/plugins/metrics/metrics.py index 0ad3eff..2f83211 100644 --- a/amarillo/plugins/metrics/metrics.py +++ b/amarillo/plugins/metrics/metrics.py @@ -21,8 +21,8 @@ logger = logging.getLogger(__name__) 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") +gtfs_download_counter = Counter("amarillo_gtfs_downloads", "How many times GTFS data was downloaded") +grfs_download_counter = Counter("amarillo_grfs_downloads", "How many times GRFS data was downloaded") def increment_gtfs_download_counter(): gtfs_download_counter.inc() @@ -30,6 +30,11 @@ def increment_gtfs_download_counter(): def increment_grfs_download_counter(): grfs_download_counter.inc() +trips_created_counter = Counter("amarillo_trips_created", "How many trips have been created") +trips_updated_counter = Counter("amarillo_trips_updated", "How many existing trips have been updated") +trips_deleted_counter = Counter("amarillo_trips_deleted", "How many trips have been deleted") + + def amarillo_trips_number_total() -> Callable[[Info], None]: METRIC = Gauge("amarillo_trips_number_total", "Total number of trips.")