count errors
This commit is contained in:
parent
243e73064a
commit
3814767e28
@ -32,6 +32,7 @@ class WsjtQueueWorker(threading.Thread):
|
|||||||
processor.decode(file)
|
processor.decode(file)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception("failed to decode job")
|
logger.exception("failed to decode job")
|
||||||
|
self.queue.onError()
|
||||||
self.queue.task_done()
|
self.queue.task_done()
|
||||||
|
|
||||||
|
|
||||||
@ -55,6 +56,8 @@ class WsjtQueue(Queue):
|
|||||||
metrics.addMetric("wsjt.queue.out", self.outCounter)
|
metrics.addMetric("wsjt.queue.out", self.outCounter)
|
||||||
self.overflowCounter = CounterMetric()
|
self.overflowCounter = CounterMetric()
|
||||||
metrics.addMetric("wsjt.queue.overflow", self.overflowCounter)
|
metrics.addMetric("wsjt.queue.overflow", self.overflowCounter)
|
||||||
|
self.errorCounter = CounterMetric()
|
||||||
|
metrics.addMetric("wsjt.queue.error", self.errorCounter)
|
||||||
self.workers = [self.newWorker() for _ in range(0, workers)]
|
self.workers = [self.newWorker() for _ in range(0, workers)]
|
||||||
|
|
||||||
def put(self, item):
|
def put(self, item):
|
||||||
@ -76,6 +79,9 @@ class WsjtQueue(Queue):
|
|||||||
worker.start()
|
worker.start()
|
||||||
return worker
|
return worker
|
||||||
|
|
||||||
|
def onError(self):
|
||||||
|
self.errorCounter.inc()
|
||||||
|
|
||||||
|
|
||||||
class WsjtChopper(threading.Thread):
|
class WsjtChopper(threading.Thread):
|
||||||
def __init__(self, source):
|
def __init__(self, source):
|
||||||
|
Loading…
Reference in New Issue
Block a user