public void recordFlush(long duration) {
        flushTimeSensor.record(duration);
    }
@Test
    public void shouldRecordFlushTime() {
        // When:
        producerMetrics.recordFlush(METRIC_VALUE);

        // Then:
        assertMetricValue(FLUSH_TIME_TOTAL);
    }