From 228468749cf343444ce3e85ab1e1c87565ffd4c3 Mon Sep 17 00:00:00 2001 From: Christopher Usher Date: Sun, 13 Oct 2019 01:47:17 +0100 Subject: [PATCH] changes based on ekim's suggestions --- cutter/cutter/main.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/cutter/cutter/main.py b/cutter/cutter/main.py index ed14186..e3dd51f 100644 --- a/cutter/cutter/main.py +++ b/cutter/cutter/main.py @@ -20,11 +20,6 @@ from common.segments import get_best_segments, cut_segments, ContainsHoles from .youtube import Youtube -videos_cut = prom.Counter( - 'videos_cut', - 'Number of videos successfully cut', - ['video_channel', 'video_quality'] -) videos_uploaded = prom.Counter( 'videos_uploaded', @@ -32,12 +27,6 @@ videos_uploaded = prom.Counter( ['video_channel', 'video_quality', 'upload_location'] ) -cutting_errors = prom.Counter( - 'cutting_errors', - 'Number of errors cutting a video', - ['video_channel', 'video_quality'] -) - upload_errors = prom.Counter( 'upload_errors', 'Number of errors uploading a video', @@ -306,7 +295,6 @@ class Cutter(object): yield chunk except Exception as ex: self.logger.exception("Error occurred while trying to cut job {}".format(format_job(job))) - cutting_errors.labels(video_channel=job.video_channel, video_quality=job.video_quality).inc() # Assumed error is not retryable, set state back to UNEDITED and set error. if not set_row(state='UNEDITED', error="Error while cutting: {}".format(ex), uploader=None): self.logger.warning("Tried to roll back row {} to unedited but it was already cancelled.".format(job.id)) @@ -325,7 +313,6 @@ class Cutter(object): .format(job.id, self.name) ) finalize_begun[0] = True - videos_cut.labels(video_channel=job.video_channel, video_quality=job.video_quality).inc() # Now we return from this generator, and any errors between now and returning # from requests.post() are not recoverable. @@ -340,8 +327,10 @@ class Cutter(object): ) except JobConsistencyError: raise # this ensures it's not caught in the next except block + upload_errors.labels(video_channel=job.video_channel, video_quality=job.video_quality, upload_location=job.upload_location).inc() except ErrorHandled: # we're aborting the cut, error handling has already happened + upload_errors.labels(video_channel=job.video_channel, video_quality=job.video_quality, upload_location=job.upload_location).inc() return except Exception as ex: self.refresh_conn()