Ejemplo n.º 1
0
    def test_process_notification(self):
        pub = self.PublisherClass()
        transformer_manager = transformer.TransformerExtensionManager(
            'ceilometer.transformer', )
        publisher_manager = publisher.PublisherExtensionManager('fake', )
        publisher_manager.extensions = [
            extension.Extension(
                'test_pub',
                None,
                None,
                pub,
            ),
        ]
        publisher_manager.by_name = dict(
            (e.name, e) for e in publisher_manager.extensions)

        notifier._pipeline_manager = pipeline.PipelineManager(
            [{
                'name': "test_pipeline",
                'interval': 60,
                'counters': ['*'],
                'transformers': [],
                'publishers': ["test_pub"],
            }], transformer_manager, publisher_manager)

        self.assertEqual(len(pub.counters), 0)
        notifier.notify(None, MESSAGE)
        self.assertTrue(len(pub.counters) > 0)
        self.assertIn('disk.ephemeral.size', [c.name for c in pub.counters])
Ejemplo n.º 2
0
    def test_process_notification(self):
        transformer_manager = transformer.TransformerExtensionManager(
            'ceilometer.transformer', )
        notifier._pipeline_manager = pipeline.PipelineManager(
            [{
                'name': "test_pipeline",
                'interval': 60,
                'counters': ['*'],
                'transformers': [],
                'publishers': ["test"],
            }], transformer_manager)

        pub = notifier._pipeline_manager.pipelines[0].publishers[0]
        self.assertEqual(0, len(pub.samples))
        notifier.notify(None, MESSAGE)
        self.assertTrue(len(pub.samples) > 0)
        self.assertIn('disk.ephemeral.size', [c.name for c in pub.samples])
Ejemplo n.º 3
0
    def test_process_notification(self):
        transformer_manager = transformer.TransformerExtensionManager(
            'ceilometer.transformer',
        )
        notifier._pipeline_manager = pipeline.PipelineManager(
            [{
                'name': "test_pipeline",
                'interval': 60,
                'counters': ['*'],
                'transformers': [],
                'publishers': ["test"],
            }],
            transformer_manager)

        pub = notifier._pipeline_manager.pipelines[0].publishers[0]
        self.assertEqual(len(pub.samples), 0)
        notifier.notify(None, MESSAGE)
        self.assertTrue(len(pub.samples) > 0)
        self.assertIn('disk.ephemeral.size',
                      [c.name for c in pub.samples])
Ejemplo n.º 4
0
    def test_process_notification(self):
        pub = self.PublisherClass()
        transformer_manager = transformer.TransformerExtensionManager(
            'ceilometer.transformer',
        )
        publisher_manager = publisher.PublisherExtensionManager(
            'fake',
        )
        publisher_manager.extensions = [
            extension.Extension(
                'test_pub',
                None,
                None,
                pub,
            ), ]
        publisher_manager.by_name = dict(
            (e.name, e)
            for e
            in publisher_manager.extensions)

        notifier._pipeline_manager = pipeline.PipelineManager(
            [{
                'name': "test_pipeline",
                'interval': 60,
                'counters': ['*'],
                'transformers': [],
                'publishers': ["test_pub"],
            }],
            transformer_manager,
            publisher_manager)

        self.assertEqual(len(pub.counters), 0)
        notifier.notify(None, MESSAGE)
        self.assertTrue(len(pub.counters) > 0)
        self.assertIn('disk.ephemeral.size',
                      [c.name for c in pub.counters])