Ejemplo n.º 1
0
class TestFluentdCollector(CollectorTestCase):

    def setUp(self):
        config = get_collector_config('FluentdCollector', {
            'interval': 10,
            'collect': {
                'kinesis': [
                    'buffer_queue_length',
                    'buffer_total_queued_size',
                    'retry_count'
                    ]
                }
        })

        self.collector = FluentdCollector(config, None)

    def test_import(self):
        self.assertTrue(FluentdCollector)

    def test_api_output_parse(self):
        f = open(os.path.join(fixtures_path, "example.stat")).read()
        stat = json.loads(f)
        self.assertTrue(len(self.collector.parse_api_output(stat)) is 3)

    def test_api_output_parse_empty(self):
        f = open(os.path.join(fixtures_path, "example_empty.stat")).read()
        stat = json.loads(f)
        self.assertTrue(len(self.collector.parse_api_output(stat)) is 0)
Ejemplo n.º 2
0
class TestFluentdCollector(CollectorTestCase):
    def setUp(self):
        config = get_collector_config(
            'FluentdCollector', {
                'interval': 10,
                'collect': {
                    'kinesis': [
                        'buffer_queue_length', 'buffer_total_queued_size',
                        'retry_count'
                    ]
                }
            })

        self.collector = FluentdCollector(config, None)

    def test_import(self):
        self.assertTrue(FluentdCollector)

    def test_api_output_parse(self):
        f = open(os.path.join(fixtures_path, "example.stat")).read()
        stat = json.loads(f)
        self.assertTrue(len(self.collector.parse_api_output(stat)) is 3)

    def test_api_output_parse_empty(self):
        f = open(os.path.join(fixtures_path, "example_empty.stat")).read()
        stat = json.loads(f)
        self.assertTrue(len(self.collector.parse_api_output(stat)) is 0)
Ejemplo n.º 3
0
    def setUp(self):
        config = get_collector_config(
            'FluentdCollector', {
                'interval': 10,
                'collect': {
                    'kinesis': [
                        'buffer_queue_length', 'buffer_total_queued_size',
                        'retry_count'
                    ]
                }
            })

        self.collector = FluentdCollector(config, None)
Ejemplo n.º 4
0
    def setUp(self):
        config = get_collector_config('FluentdCollector', {
            'interval': 10,
            'collect': {
                'kinesis': [
                    'buffer_queue_length',
                    'buffer_total_queued_size',
                    'retry_count'
                    ]
                }
        })

        self.collector = FluentdCollector(config, None)