Add downloaded frame counter
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Lauri Võsandi 2022-09-21 09:03:40 +03:00
parent ce95ffc8d3
commit 5a1ea54e49

View File

@ -128,6 +128,7 @@ gauge_queue_frames.labels("download").set(0)
gauge_queue_frames.labels("hold").set(0) gauge_queue_frames.labels("hold").set(0)
gauge_queue_frames.labels("upload").set(0) gauge_queue_frames.labels("upload").set(0)
counter_frames.labels("motion").inc(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 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__) j = "%s.%s" % (e.__class__.__module__, e.__class__.__name__)
logger.info("Caught exception %s", j) logger.info("Caught exception %s", j)
counter_errors.labels("download", j).inc() counter_errors.labels("download", j).inc()
else:
counter_frames.labels("downloaded").inc()
await asyncio.sleep(1) await asyncio.sleep(1)
app = Sanic("camdetect") app = Sanic("camdetect")