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"], ["channel", "quality"],
) )
ad_segments_ignored = prom.Counter(
"ad_segments_ignored",
"Number of ad segments we saw and avoided downloading",
["channel", "quality"],
)
class TimedOutError(Exception): class TimedOutError(Exception):
pass pass
@ -358,7 +364,8 @@ class StreamWorker(object):
date = None # tracks date in case some segment doesn't include it date = None # tracks date in case some segment doesn't include it
for segment in playlist.segments: for segment in playlist.segments:
if segment.ad_reason: 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 continue
# We've got our first non-ad segment, so we're good to take it from here. # We've got our first non-ad segment, so we're good to take it from here.

Loading…
Cancel
Save