diff --git a/util/saas/metricqueue.py b/util/saas/metricqueue.py index f4ad40231..1405f384c 100644 --- a/util/saas/metricqueue.py +++ b/util/saas/metricqueue.py @@ -1,11 +1,19 @@ -from Queue import Queue +import logging + +from Queue import Queue, Full + + +logger = logging.getLogger(__name__) class MetricQueue(object): def __init__(self): - self._queue = Queue() + self._queue = Queue(10000) def put(self, *args, **kwargs): - self._queue.put((args, kwargs)) + try: + self._queue.put_nowait((args, kwargs)) + except Full: + logger.error('Metric queue full') def get(self): return self._queue.get()