@Override
    public void report() {
        BatchPoints report = buildReport();
        if (report != null) {
            influxDB.write(report);
        }
    }
@Test
    void testMetricReporting() {
        String retentionPolicy = "one_hour";
        InfluxDB.ConsistencyLevel consistencyLevel = InfluxDB.ConsistencyLevel.ANY;
        InfluxdbReporter reporter = createReporter(retentionPolicy, consistencyLevel);

        String metricName = "TestCounter";
        Counter counter = new SimpleCounter();
        reporter.notifyOfAddedMetric(counter, metricName, metricGroup);
        counter.inc(42);

        stubFor(post(urlPathEqualTo("/write")).willReturn(aResponse().withStatus(200)));

        reporter.report();

        verify(
                postRequestedFor(urlPathEqualTo("/write"))
                        .withQueryParam("db", equalTo(TEST_INFLUXDB_DB))
                        .withQueryParam("rp", equalTo(retentionPolicy))
                        .withQueryParam(
                                "consistency", equalTo(consistencyLevel.name().toLowerCase()))
                        .withHeader("Content-Type", containing("text/plain"))
                        .withRequestBody(
                                containing(
                                        "taskmanager_"
                                                + metricName
                                                + ",host="
                                                + METRIC_HOSTNAME
                                                + " count=42i")));
    }