示例#1
0
    def testEqual(self):
        m1 = Metric(name="test", value=10, ts=0)
        m2 = Metric(name="test", value=10, ts=0)

        self.assertEqual(m1, m2)
        self.assertFalse(m1 < m2)
        self.assertFalse(m1 > m2)
        self.assertTrue(m1 == m2)
示例#2
0
 def add(self, value):
     self._values.add(Metric(name=self.name, value=value))
示例#3
0
 def __init__(self, cleanup=None):
     super(HeartBeat, self).__init__(cleanup)
     self.value = 0
     self.add(Metric(name='heartbeat', value=self.value))
示例#4
0
 def on_send(self):
     self.value += 1
     self._values = set([])
     self.add(Metric(name='heartbeat', value=self.value))