mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-25 19:15:51 +03:00
Bugfix to rendering output of vectored TimerMetrics
This commit is contained in:
parent
f9478e475b
commit
b3a0179d64
2 changed files with 6 additions and 7 deletions
|
@ -127,9 +127,8 @@ class TimerMetric(CounterMetric):
|
|||
def render_item(self, k):
|
||||
keystr = self._render_key(k)
|
||||
|
||||
return ["%s%s:count %d" % (self.name, keystr, self.counts[k]),
|
||||
"%s%s:msec %d" % (self.name, keystr, self.times[k])]
|
||||
|
||||
return ["%s:count%s %d" % (self.name, keystr, self.counts[k]),
|
||||
"%s:msec%s %d" % (self.name, keystr, self.times[k])]
|
||||
|
||||
|
||||
class CacheMetric(object):
|
||||
|
|
|
@ -124,10 +124,10 @@ class TimerMetricTestCase(unittest.TestCase):
|
|||
metric.inc_time(800, "INSERT")
|
||||
|
||||
self.assertEquals(metric.render(), [
|
||||
"queries{verb=INSERT}:count 1",
|
||||
"queries{verb=INSERT}:msec 800",
|
||||
"queries{verb=SELECT}:count 2",
|
||||
"queries{verb=SELECT}:msec 500",
|
||||
"queries:count{verb=INSERT} 1",
|
||||
"queries:msec{verb=INSERT} 800",
|
||||
"queries:count{verb=SELECT} 2",
|
||||
"queries:msec{verb=SELECT} 500",
|
||||
])
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue