summary refs log tree commit diff
path: root/synapse/metrics
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2016-10-19 13:53:55 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2016-10-19 15:05:15 +0100
commitb21b9dbc378ae336f70d832f19ce123b3f82f3be (patch)
tree4ab01907c9e13d9f7bcecc886c9046ad9b3d9fb0 /synapse/metrics
parentMerge pull request #1170 from matrix-org/dbkr/password_reset_case_insensitive (diff)
downloadsynapse-b21b9dbc378ae336f70d832f19ce123b3f82f3be.tar.xz
Callback metric values might not just be integers - allow floats
Diffstat (limited to '')
-rw-r--r--synapse/metrics/metric.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/metrics/metric.py b/synapse/metrics/metric.py
index e81af29895..e87b2b80a7 100644
--- a/synapse/metrics/metric.py
+++ b/synapse/metrics/metric.py
@@ -98,9 +98,9 @@ class CallbackMetric(BaseMetric):
         value = self.callback()
 
         if self.is_scalar():
-            return ["%s %d" % (self.name, value)]
+            return ["%s %.12g" % (self.name, value)]
 
-        return ["%s%s %d" % (self.name, self._render_key(k), value[k])
+        return ["%s%s %.12g" % (self.name, self._render_key(k), value[k])
                 for k in sorted(value.keys())]