From 4d3fd0815ead4d7643e3d1b1554728e96ff0af9c Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Sun, 6 Jan 2019 05:43:08 -0800 Subject: [PATCH] backfiller: Track number of successful backfills Other stats can come later, but this one is important as it tells us if a downloader hasn't been doing its job. --- backfiller/backfiller/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backfiller/backfiller/main.py b/backfiller/backfiller/main.py index d979748..c120668 100644 --- a/backfiller/backfiller/main.py +++ b/backfiller/backfiller/main.py @@ -15,6 +15,13 @@ import prometheus_client as prom import common +segments_backfilled = prom.Counter( + 'segments_backfilled', + "Number of segments successfully backfilled", + ["remote", "stream", "variant", "hour"], +) + + HOUR_FMT = '%Y-%m-%dT%H' TIMEOUT = 5 #default timeout for remote requests @@ -118,6 +125,7 @@ def get_remote_segment(base_dir, node, stream, variant, hour, missing_segment, raise logging.debug('Saving completed segment {} as {}'.format(temp_path, path)) common.rename(temp_path, path) + segments_backfilled.labels(remote=node, stream=stream, variant=variant, hour=hour).inc() def backfill(base_dir, stream, variants, hours=None, nodes=None):