public void recordRequestLatency(long responseLatencyMs) {
        this.commitSensor.record(responseLatencyMs);
    }
@Test
    public void testOffsetCommitMetrics() {
        // Assuming 'metrics' is an instance of your Metrics class

        // Create an instance of OffsetCommitMetricsManager
        OffsetCommitMetricsManager metricsManager = new OffsetCommitMetricsManager(metrics);

        // Assert the existence of metrics
        assertNotNull(metrics.metric(metricsManager.commitLatencyAvg));
        assertNotNull(metrics.metric(metricsManager.commitLatencyMax));
        assertNotNull(metrics.metric(metricsManager.commitRate));
        assertNotNull(metrics.metric(metricsManager.commitTotal));

        // Record request latency
        metricsManager.recordRequestLatency(100);
        metricsManager.recordRequestLatency(102);
        metricsManager.recordRequestLatency(98);

        // Assert the recorded latency
        assertEquals(100d, metrics.metric(metricsManager.commitLatencyAvg).metricValue());
        assertEquals(102d, metrics.metric(metricsManager.commitLatencyMax).metricValue());
        assertEquals(0.1d, metrics.metric(metricsManager.commitRate).metricValue());
        assertEquals(3d, metrics.metric(metricsManager.commitTotal).metricValue());
    }