Skip to content
Browse files

resolve merge

  • Loading branch information...
2 parents b9fa22d + a0ada48 commit 51caa6d80273ab8eb6d6fee23995a3ea4f03b6b9 @bbangert bbangert committed
Showing with 38 additions and 3 deletions.
  1. +2 −2 Makefile
  2. +1 −0 dev-reqs.txt
  3. +6 −0 etc/production.ini
  4. +5 −0 etc/queuey-dev.ini
  5. +6 −0 etc/queuey-test.ini
  6. +1 −0 prod-reqs.txt
  7. +1 −1 queuey.spec
  8. +6 −0 queuey/__init__.py
  9. +5 −0 queuey/resources.py
  10. +5 −0 queuey/tests/test.ini
View
4 Makefile
@@ -65,8 +65,8 @@ $(CASSANDRA):
echo "Installing Cassandra"
mkdir -p bin
cd bin && \
- curl --silent http://downloads.datastax.com/community/dsc-cassandra-1.0.7-bin.tar.gz | tar -zvx >/dev/null 2>&1
- mv bin/dsc-cassandra-1.0.7 bin/cassandra
+ curl --silent http://downloads.datastax.com/community/dsc-cassandra-1.0.8-bin.tar.gz | tar -zvx >/dev/null 2>&1
+ mv bin/dsc-cassandra-1.0.8 bin/cassandra
cp etc/cassandra/cassandra.yaml bin/cassandra/conf/cassandra.yaml
cp etc/cassandra/log4j-server.properties bin/cassandra/conf/log4j-server.properties
cd bin/cassandra/lib && \
View
1 dev-reqs.txt
@@ -17,6 +17,7 @@ distribute==0.6.25
flake8==1.0
gunicorn==0.14.2
meld3==0.6.8
+metlog-py==0.8.2
mock==0.8
mozsvc==0.1
nose==1.1.2
View
6 etc/production.ini
@@ -3,6 +3,12 @@
logger_name = queuey
debug = false
+[metlog]
+backend = mozsvc.metrics.MetlogPlugin
+enabled = true
+sender_backend = metlog.senders.ZmqPubSender
+sender_bindstrs = tcp://127.0.0.1:5565
+
[storage]
backend = queuey.storage.cassandra.CassandraQueueBackend
host = localhost
View
5 etc/queuey-dev.ini
@@ -3,6 +3,11 @@
logger_name = queuey
debug = true
+[metlog]
+logger = queuey
+backend = mozsvc.metrics.MetlogPlugin
+sender_class = metlog.senders.dev.StdOutSender
+
[storage]
backend = queuey.storage.cassandra.CassandraQueueBackend
host = localhost
View
6 etc/queuey-test.ini
@@ -3,6 +3,12 @@
logger_name = queuey
debug = false
+[metlog]
+logger = queuey
+backend = mozsvc.metrics.MetlogPlugin
+sender_backend = metlog.senders.ZmqPubSender
+sender_bindstrs = tcp://127.0.0.1:5565
+
[storage]
backend = queuey.storage.cassandra.CassandraQueueBackend
host = 192.168.2.20,192.168.2.23
View
1 prod-reqs.txt
@@ -11,6 +11,7 @@ cef==0.3
colander==0.9.7
gunicorn==0.14.2
meld3==0.6.8
+metlog-py==0.8.2
mozsvc==0.1
ordereddict==1.1
pycassa==1.5.1
View
2 queuey.spec
@@ -14,7 +14,7 @@ BuildRoot: %{_tmppath}/%{pythonname}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
Vendor: Services team <services-dev@mozilla.org>
-Requires: nginx gunicorn python26 python26-argparse python26-cef python26-chameleon python26-colander python26-gunicorn python26-mako python26-markupsafe python26-meld3 python26-mozsvc python26-ordereddict python26-paste python26-pastedeploy python26-pastescript python26-pycassa python26-pygments python26-pyramid python26-setuptools python26-repoze.lru python26-simplejson python26-thrift python26-translationstring python26-venusian python26-webob python26-wsgiref python26-zope.component python26-zope.deprecation python26-zope.event python26-zope.interface python26-ujson
+Requires: nginx gunicorn pyzmq python26 python26-argparse python26-cef python26-chameleon python26-colander python26-gunicorn python26-mako python26-markupsafe python26-meld3 python26-mozsvc python26-ordereddict python26-paste python26-pastedeploy python26-pastescript python26-pycassa python26-pygments python26-pyramid python26-setuptools python26-repoze.lru python26-simplejson python26-thrift python26-translationstring python26-venusian python26-webob python26-wsgiref python26-zope.component python26-zope.deprecation python26-zope.event python26-zope.interface python26-ujson python26-metlog-py
Url: ${url}
View
6 queuey/__init__.py
@@ -6,6 +6,7 @@
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.config import Configurator
+from metlog.config import client_from_dict_config
from mozsvc.config import Config
from queuey.resources import Root
@@ -41,6 +42,11 @@ def main(global_config, **settings):
config.registry['backend_metadata'] = configure_from_settings(
'metadata', settings['config'].get_map('metadata'))
+ # Load the Metlog Client instance
+ config.registry['metlog_client'] = client_from_dict_config(
+ settings['config'].get_map('metlog')
+ )
+
# Load the application keys
app_vals = settings['config'].get_map('application_keys')
app_keys = {}
View
5 queuey/resources.py
@@ -120,6 +120,7 @@ def __init__(self, request, queue_name, queue_data):
self.metadata = request.registry['backend_metadata']
self.storage = request.registry['backend_storage']
self.queue_name = queue_name
+ self.metlog = request.registry['metlog_client']
principles = queue_data.pop('principles', '').split(',')
self.principles = [x.strip() for x in principles if x]
@@ -182,6 +183,8 @@ def push_batch(self, messages):
for i, msg in enumerate(results):
rl.append({'key': msg[0], 'timestamp': repr(msg[1]),
'partition': messages[i]['partition']})
+ self.metlog.incr('%s.new_message' % self.application,
+ count=len(results))
return rl
def get_messages(self, since=None, limit=None, order=None, partitions=None):
@@ -198,6 +201,8 @@ def get_messages(self, since=None, limit=None, order=None, partitions=None):
res['partition'] = int(res['queue_name'].split(':')[-1])
del res['queue_name']
res['timestamp'] = repr(res['timestamp'])
+ self.metlog.incr('%s.get_message' % self.application,
+ count=len(results))
return results
def delete(self):
View
5 queuey/tests/test.ini
@@ -3,6 +3,11 @@
logger_name = queuey
debug = false
+[metlog]
+logger = queuey
+backend = mozsvc.metrics.MetlogPlugin
+sender_class = metlog.senders.dev.DebugCaptureSender
+
[storage]
backend = queuey.storage.cassandra.CassandraQueueBackend
host = localhost

0 comments on commit 51caa6d

Please sign in to comment.
Something went wrong with that request. Please try again.