Ejemplo n.º 1
0
    def test_docker(self, aggregator, dd_environment, dockerinstance):
        """
        Testing metrics emitted from docker container.
        """

        check = CoreDNSCheck('coredns', {}, {}, [dockerinstance])
        check.check(dockerinstance)

        # include_metrics that can be reproduced in a docker based test environment
        include_metrics = [
            NAMESPACE + '.request_count',
            NAMESPACE + '.cache_size.count',
            NAMESPACE + '.request_type_count',
            NAMESPACE + '.cache_misses_count',
            NAMESPACE + '.response_code_count',
            NAMESPACE + '.proxy_request_count',
            NAMESPACE + '.response_size.bytes.sum',
            NAMESPACE + '.response_size.bytes.count',
            NAMESPACE + '.request_size.bytes.sum',
            NAMESPACE + '.request_size.bytes.count',
            NAMESPACE + '.proxy_request_duration.seconds.sum',
            NAMESPACE + '.proxy_request_duration.seconds.count',
            NAMESPACE + '.request_duration.seconds.sum',
            NAMESPACE + '.request_duration.seconds.count',
        ]

        for metric in include_metrics:
            aggregator.assert_metric(metric)
Ejemplo n.º 2
0
def test_check(aggregator, mock_coredns):
    c = CoreDNSCheck(CHECK_NAME, None, {}, instance)
    c.check(instance)

    aggregator.assert_metric(NAMESPACE + '.response_code_count')
    aggregator.assert_metric(NAMESPACE + '.response_code_count.count')
    aggregator.assert_metric(NAMESPACE + '.proxy_request_count')
    aggregator.assert_metric(NAMESPACE + '.proxy_request_count.count')
    aggregator.assert_metric(NAMESPACE + '.cache_hits_count')
    aggregator.assert_metric(NAMESPACE + '.cache_hits_count.count')
    aggregator.assert_metric(NAMESPACE + '.cache_misses_count')
    aggregator.assert_metric(NAMESPACE + '.cache_misses_count.count')
    aggregator.assert_metric(NAMESPACE + '.request_count')
    aggregator.assert_metric(NAMESPACE + '.request_count.count')
    aggregator.assert_metric(NAMESPACE + '.request_type_count')
    aggregator.assert_metric(NAMESPACE + '.request_type_count.count')
    aggregator.assert_metric(NAMESPACE + '.request_duration.seconds.sum')
    aggregator.assert_metric(NAMESPACE + '.request_duration.seconds.count')
    aggregator.assert_metric(NAMESPACE + '.proxy_request_duration.seconds.sum')
    aggregator.assert_metric(NAMESPACE +
                             '.proxy_request_duration.seconds.count')
    aggregator.assert_metric(NAMESPACE + '.request_size.bytes.sum')
    aggregator.assert_metric(NAMESPACE + '.request_size.bytes.count')
    aggregator.assert_metric(NAMESPACE + '.cache_size.count')

    assert aggregator.metrics_asserted_pct == 100.0
Ejemplo n.º 3
0
    def test_docker(self, aggregator, dd_environment, dockerinstance):
        """
        Testing metrics emitted from docker container.
        """

        check = CoreDNSCheck(CHECK_NAME, {}, [dockerinstance])
        check.check(dockerinstance)

        for metric in METRICS:
            aggregator.assert_metric(metric)
Ejemplo n.º 4
0
    def test_check(self, aggregator, mock_get, instance):
        """
        Testing CoreDNS check.
        """

        check = CoreDNSCheck('coredns', {}, {}, [instance])
        check.check(instance)

        # check that we then get the count metrics also
        check.check(instance)

        for metric in self.METRICS:
            aggregator.assert_metric(metric)
Ejemplo n.º 5
0
    def test_docker(self, aggregator, dd_environment, dockerinstance):
        """
        Testing metrics emitted from docker container.
        """

        check = CoreDNSCheck(CHECK_NAME, {}, [dockerinstance])
        check.check(dockerinstance)

        for metric in METRICS:
            aggregator.assert_metric(metric)

        aggregator.assert_all_metrics_covered()
        aggregator.assert_metrics_using_metadata(get_metadata_metrics(),
                                                 check_submission_type=True)
Ejemplo n.º 6
0
    def test_check(self, aggregator, mock_get, instance):
        """
        Testing CoreDNS check.
        """

        check = CoreDNSCheck(CHECK_NAME, {}, [instance])
        check.check(instance)

        # check that we then get the count metrics also
        check.check(instance)

        metrics = METRICS + [NAMESPACE + '.cache_hits_count']

        for metric in metrics:
            aggregator.assert_metric(metric)