@Override
    public void recordThreadIdleTime(long idleTimeMs) {
        threadIdleSensor.record(idleTimeMs);
    }
@Test
    public void testThreadIdleSensor() {
        Time time = new MockTime();
        Metrics metrics = new Metrics(time);

        GroupCoordinatorRuntimeMetrics runtimeMetrics = new GroupCoordinatorRuntimeMetrics(metrics);
        IntStream.range(0, 3).forEach(i -> runtimeMetrics.recordThreadIdleTime((i + 1) * 1000L));

        org.apache.kafka.common.MetricName metricName = metrics.metricName(
            "thread-idle-ratio-avg", METRICS_GROUP);
        KafkaMetric metric = metrics.metrics().get(metricName);
        assertEquals(6 / 30.0, metric.metricValue()); // 'total_ms / window_ms'
    }