本文整理汇总了Python中metrology.Metrology.histogram方法的典型用法代码示例。如果您正苦于以下问题:Python Metrology.histogram方法的具体用法?Python Metrology.histogram怎么用?Python Metrology.histogram使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类metrology.Metrology
的用法示例。
在下文中一共展示了Metrology.histogram方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import histogram [as 别名]
def setUp(self):
self.reporter = GraphiteReporter('localhost', 3333)
Metrology.meter('meter').mark()
Metrology.counter('counter').increment()
Metrology.timer('timer').update(1.5)
Metrology.utilization_timer('utimer').update(1.5)
Metrology.histogram('histogram').update(1.5)
示例2: test_send_batch
# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import histogram [as 别名]
def test_send_batch(self, mock):
self.reporter = GraphiteReporter('localhost', 3333, batch_size=2)
Metrology.meter('meter').mark()
Metrology.counter('counter').increment()
Metrology.timer('timer').update(5)
Metrology.utilization_timer('utimer').update(5)
Metrology.histogram('histogram').update(5)
self.reporter.write()
self.assertTrue(mock.send.assert_called())
self.assertEqual(25, len(mock.sendall.call_args_list))
self.reporter.stop()
示例3: test_send_batch
# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import histogram [as 别名]
def test_send_batch(self, mock):
self.reporter = GraphiteReporter("localhost", 3334, pickle=True, batch_size=2)
Metrology.meter("meter").mark()
Metrology.counter("counter").increment()
Metrology.timer("timer").update(5)
Metrology.utilization_timer("utimer").update(5)
Metrology.histogram("histogram").update(5)
self.reporter.write()
self.assertTrue(mock.sendall.assert_called())
self.assertEqual(25, len(mock.sendall.call_args_list))
self.reporter.stop()
示例4: test_histogram
# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import histogram [as 别名]
def test_histogram(self):
self.assertTrue(Metrology.histogram('test') is not None)