This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/util/saas/metricqueue.py
Matt Jibson cfb6e884f2 Refactor metric collection
This change adds a generic queue onto which metrics can be pushed. A
separate module removes metrics from the queue and adds them to Cloudwatch.
Since these are now separate ideas, we can easily change the consumer from
Cloudwatch to anything else.

This change maintains near feature parity (the only change is there is now
just one queue instead of two - not a big deal).
2015-08-12 12:15:52 -04:00

11 lines
218 B
Python

from Queue import Queue
class MetricQueue(object):
def __init__(self):
self._queue = Queue()
def put(self, *args, **kwargs):
self._queue.put((args, kwargs))
def get(self):
return self._queue.get()