void recordLatency(String node, long requestLatencyMs) {
        fetchLatency.record(requestLatencyMs);
        if (!node.isEmpty()) {
            String nodeTimeName = "node-" + node + ".latency";
            Sensor nodeRequestTime = this.metrics.getSensor(nodeTimeName);
            if (nodeRequestTime != null)
                nodeRequestTime.record(requestLatencyMs);
        }
    }
@Test
    public void testLatency() {
        metricsManager.recordLatency("", 123);
        time.sleep(metrics.config().timeWindowMs() + 1);
        metricsManager.recordLatency("", 456);

        assertEquals(289.5, metricValue(metricsRegistry.fetchLatencyAvg), EPSILON);
        assertEquals(456, metricValue(metricsRegistry.fetchLatencyMax), EPSILON);
    }