Ejemplo n.º 1
0
class TestExampleCollector(CollectorTestCase):
    def setUp(self):
        config = get_collector_config('ExampleCollector', {'interval': 10})

        self.collector = ExampleCollector(config, None)

    @patch.object(Collector, 'publish')
    def test(self, publish_mock):
        self.collector.collect()

        metrics = {'my.example.metric': 42}

        self.setDocExample(self.collector.__class__.__name__, metrics)
        self.assertPublishedMany(publish_mock, metrics)
Ejemplo n.º 2
0
class TestExampleCollector(CollectorTestCase):
    def setUp(self):
        config = get_collector_config('ExampleCollector', {
            'interval'  : 10
        })

        self.collector = ExampleCollector(config, None)

    @patch.object(Collector, 'publish')
    def test(self, publish_mock):
        self.collector.collect()

        self.assertPublishedMany(publish_mock, {
            'my.example.metric' :  42
        })
Ejemplo n.º 3
0
class TestExampleCollector(CollectorTestCase):
    def setUp(self):
        config = get_collector_config('ExampleCollector', {
            'interval': 10
        })

        self.collector = ExampleCollector(config, None)

    @patch.object(Collector, 'publish')
    def test(self, publish_mock):
        self.collector.collect()

        metrics = {
            'my.example.metric':  42
        }

        self.setDocExample(collector=self.collector.__class__.__name__,
                           metrics=metrics,
                           defaultpath=self.collector.config['path'])
        self.assertPublishedMany(publish_mock, metrics)
Ejemplo n.º 4
0
    def setUp(self):
        config = get_collector_config('ExampleCollector', {
            'interval'  : 10
        })

        self.collector = ExampleCollector(config, None)
Ejemplo n.º 5
0
    def setUp(self):
        config = get_collector_config('ExampleCollector', {'interval': 10})

        self.collector = ExampleCollector(config, None)