diff --git a/autopush/metrics.py b/autopush/metrics.py index ac79bdb1..b4375cbe 100644 --- a/autopush/metrics.py +++ b/autopush/metrics.py @@ -50,7 +50,7 @@ def timing(self, name, duration, **kwargs): class TwistedMetrics(object): """Twisted implementation of statsd output""" def __init__(self, statsd_host="localhost", statsd_port=8125): - self.client = TwistedStatsDClient(statsd_host, statsd_port) + self.client = TwistedStatsDClient.create(statsd_host, statsd_port) self._metric = Metrics(connection=self.client, namespace="autopush") def start(self): diff --git a/autopush/tests/test_metrics.py b/autopush/tests/test_metrics.py index 5f3ab045..8e10d704 100644 --- a/autopush/tests/test_metrics.py +++ b/autopush/tests/test_metrics.py @@ -35,7 +35,7 @@ class TwistedMetricsTestCase(unittest.TestCase): @patch("autopush.metrics.reactor") def test_basic(self, mock_reactor): twisted.internet.base.DelayedCall.debug = True - m = TwistedMetrics() + m = TwistedMetrics('127.0.0.1') m.start() ok_(len(mock_reactor.mock_calls) > 0) m._metric = Mock()