From 5a1ea54e494cfe8751ec6b4b23bf6dd398aed685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Wed, 21 Sep 2022 09:03:40 +0300 Subject: [PATCH] Add downloaded frame counter --- camdetect.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/camdetect.py b/camdetect.py index ed1cf89..7df979d 100755 --- a/camdetect.py +++ b/camdetect.py @@ -128,6 +128,7 @@ gauge_queue_frames.labels("download").set(0) gauge_queue_frames.labels("hold").set(0) gauge_queue_frames.labels("upload").set(0) counter_frames.labels("motion").inc(0) +counter_frames.labels("downloaded").inc(0) assert SLIDE_WINDOW <= 8 # This is 256 frames which should be enough @@ -432,6 +433,8 @@ async def downloader(queue: asyncio.Queue): j = "%s.%s" % (e.__class__.__module__, e.__class__.__name__) logger.info("Caught exception %s", j) counter_errors.labels("download", j).inc() + else: + counter_frames.labels("downloaded").inc() await asyncio.sleep(1) app = Sanic("camdetect")