Created
November 7, 2013 07:49
-
-
Save justinvdm/7350707 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vumi/blinkenlights/metrics.py b/vumi/blinkenlights/metrics.py | |
index 331f43d..386fdac 100644 | |
--- a/vumi/blinkenlights/metrics.py | |
+++ b/vumi/blinkenlights/metrics.py | |
@@ -46,7 +46,7 @@ class MetricManager(Publisher): | |
def start(self, channel): | |
"""Start publishing metrics in a loop.""" | |
super(MetricManager, self).start(channel) | |
- self._task = LoopingCall(self._publish_metrics) | |
+ self._task = LoopingCall(self.publish_metrics) | |
done = self._task.start(self._publish_interval, now=False) | |
done.addErrback(lambda failure: log.err(failure, | |
"MetricManager publishing task died")) | |
@@ -57,7 +57,7 @@ class MetricManager(Publisher): | |
self._task.stop() | |
self._task = None | |
- def _publish_metrics(self): | |
+ def publish_metrics(self): | |
msg = MetricMessage() | |
# oneshot metrics | |
oneshots, self._oneshot_msgs = self._oneshot_msgs, [] | |
diff --git a/vumi/blinkenlights/tests/test_metrics.py b/vumi/blinkenlights/tests/test_metrics.py | |
index cce717f..3beff73 100644 | |
--- a/vumi/blinkenlights/tests/test_metrics.py | |
+++ b/vumi/blinkenlights/tests/test_metrics.py | |
@@ -95,7 +95,7 @@ class TestMetricManager(TestCase): | |
broker = yield self.start_manager(mm) | |
cnt.inc() | |
- mm._publish_metrics() | |
+ mm.publish_metrics() | |
self._check_msg(broker, mm, cnt, [1]) | |
@inlineCallbacks | |
@@ -105,7 +105,7 @@ class TestMetricManager(TestCase): | |
broker = yield self.start_manager(mm) | |
mm.oneshot(cnt, 1) | |
- mm._publish_metrics() | |
+ mm.publish_metrics() | |
self._check_msg(broker, mm, cnt, [1]) | |
@inlineCallbacks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment