def test_submit_gauge(instance, aggregator): check = MaprCheck('mapr', {}, [instance]) check.submit_metric(KAFKA_METRIC) aggregator.assert_metric( 'mapr.process.context_switch_involuntary', value=6308, tags=[ 'clustername:demo', 'process_name:apiserver', 'clusterid:7616098736519857348', 'fqdn:mapr-lab-2-ghs6.c.datadog-integrations-lab.internal', ], )
def test_submit_bucket(instance, aggregator): check = MaprCheck('mapr', {}, [instance]) check.submit_metric(DISTRIBUTION_METRIC) expected_tags = [ "mapr_cluster_id:7616098736519857348", "mapr_cluster:demo", "fqdn:mapr-lab-2-dhk4.c.datadog-integrations-lab.internal", "noindex://primary", "rpc_type:put", "table_fid:2070.42.262546", "table_path:/var/mapr/mapr.monitoring/tsdb-meta", ] aggregator.assert_histogram_bucket('mapr.db.table.latency', 21, 2, 5, False, 'stubbed.hostname', expected_tags) aggregator.assert_histogram_bucket('mapr.db.table.latency', 11, 5, 10, False, 'stubbed.hostname', expected_tags) aggregator.assert_all_metrics_covered() # No metrics submitted
def test_submit_gauge_additional_tags(instance, aggregator): instance['tags'] = ["foo:bar", "baz:biz"] check = MaprCheck('mapr', {}, [instance]) check.submit_metric(KAFKA_METRIC) aggregator.assert_metric( 'mapr.process.context_switch_involuntary', tags=[ 'clustername:demo', 'process_name:apiserver', 'clusterid:7616098736519857348', 'fqdn:mapr-lab-2-ghs6.c.datadog-integrations-lab.internal', 'foo:bar', 'baz:biz', ], )