

@patch.object(GraphiteReporter, 'socket')
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.called)
    self.assertEqual(25, len(mock.sendall.call_args_list))
    self.reporter.stop()

dataset/ETHPy150Open cyberdelia/metrology/tests/reporter/test_graphite_pickle.py GraphiteReporterTest.test_send_batch/original