Exemplo n.º 1
0
 def test_log_tagged(self):
     tags = {"test": "true"}
     histogram = metrics.Histogram(self.transport, b"example_hist", tags)
     self.assertEqual(histogram.tags, tags)
     histogram.add_sample(33)
     self.assertEqual(self.transport.send.call_count, 1)
     self.assertEqual(self.transport.send.call_args, mock.call(b"example_hist,test=true:33|h"))
Exemplo n.º 2
0
 def test_log(self):
     histogram = metrics.Histogram(self.transport, b"example_hist")
     histogram.add_sample(33)
     self.assertEqual(self.transport.send.call_count, 1)
     self.assertEqual(self.transport.send.call_args,
                      mock.call(b"example_hist:33|h"))