def METHOD_NAME(
    aggregator,
    dd_run_check,
    mock_http_response,
    with_buckets,
    use_process_start_time,
    expect_first_flush,
    agent_start_time,
    process_start_time,
):
    mock_http_response(_make_test_data(process_start_time))
    check = get_check(
        {
            'metrics': ['.*'],
            'use_process_start_time': use_process_start_time,
            'histogram_buckets_as_distributions': with_buckets,
        }
    )
    datadog_agent.set_process_start_time(agent_start_time)
    for _ in range(0, 5):
        aggregator.reset()
        dd_run_check(check)
        aggregator.assert_metric(
            'test.go_memstats_alloc_bytes.count',
            metric_type=aggregator.MONOTONIC_COUNT,
            count=1,
            flush_first_value=expect_first_flush,
        )
        aggregator.assert_metric(
            'test.go_gc_duration_seconds.count',
            metric_type=aggregator.MONOTONIC_COUNT,
            count=1,
            flush_first_value=expect_first_flush,
        )
        if with_buckets:
            aggregator.assert_histogram_bucket(
                'test.skydns_skydns_dns_request_duration_seconds',
                None,
                None,
                None,
                True,
                None,
                None,
                count=2,
                flush_first_value=expect_first_flush,
            )
        else:
            aggregator.assert_metric(
                'test.skydns_skydns_dns_request_duration_seconds.count',
                metric_type=aggregator.MONOTONIC_COUNT,
                count=1,
                flush_first_value=expect_first_flush,
            )
            aggregator.assert_metric(
                'test.skydns_skydns_dns_request_duration_seconds.sum',
                metric_type=aggregator.MONOTONIC_COUNT,
                count=1,
                flush_first_value=expect_first_flush,
            )
            aggregator.assert_metric(
                'test.skydns_skydns_dns_request_duration_seconds.bucket',
                metric_type=aggregator.MONOTONIC_COUNT,
                count=1,
                flush_first_value=expect_first_flush,
            )
        expect_first_flush = True