Track number of ignored ads

pull/184/head
Mike Lang 4 years ago committed by Mike Lang
parent 50770651ce
commit 5ccb5afff1

@ -43,6 +43,12 @@ latest_segment = prom.Gauge(
["channel", "quality"],
)
ad_segments_ignored = prom.Counter(
"ad_segments_ignored",
"Number of ad segments we saw and avoided downloading",
["channel", "quality"],
)
class TimedOutError(Exception):
pass
@ -358,7 +364,8 @@ class StreamWorker(object):
date = None # tracks date in case some segment doesn't include it
for segment in playlist.segments:
if segment.ad_reason:
self.logger.debug("Ignoring ad segment: {}".format(segment.ad_reason))
self.logger.info("Ignoring ad segment: {}".format(segment.ad_reason))
ad_segments_ignored.labels(self.manager.channel, self.quality).inc()
continue
# We've got our first non-ad segment, so we're good to take it from here.

Loading…
Cancel
Save