Skip to content

Commit 9294f46

Browse files
committed
Fix CI issues
1 parent 18994d1 commit 9294f46

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

metadata/src/main/java/org/apache/kafka/controller/metrics/YammerTimeRatio.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717

1818
package org.apache.kafka.controller.metrics;
1919

20-
import com.yammer.metrics.core.Gauge;
2120
import org.apache.kafka.raft.internals.TimeRatio;
2221

22+
import com.yammer.metrics.core.Gauge;
23+
2324
/**
2425
* Yammer Metrics facade for TimeRatio.
2526
* This class provides a Gauge interface for Yammer metrics registry
@@ -49,5 +50,7 @@ public void record(double idleDurationMs, long currentTimeMs) {
4950
* @return The ratio of idle time to total time (between 0.0 and 1.0)
5051
*/
5152
@Override
52-
public Double value() { return timeRatio.measure(); }
53+
public Double value() {
54+
return timeRatio.measure();
55+
}
5356
}

metadata/src/test/java/org/apache/kafka/controller/metrics/QuorumControllerMetricsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public void testMetricNames() {
4545
Set<String> expected = Set.of(
4646
"kafka.controller:type=ControllerEventManager,name=EventQueueProcessingTimeMs",
4747
"kafka.controller:type=ControllerEventManager,name=EventQueueTimeMs",
48+
"kafka.controller:type=ControllerEventManager,name=AvgIdleRatio",
4849
"kafka.controller:type=KafkaController,name=ActiveControllerCount",
49-
"kafka.controller:type=KafkaController,name=AvgIdleRatio",
5050
"kafka.controller:type=KafkaController,name=EventQueueOperationsStartedCount",
5151
"kafka.controller:type=KafkaController,name=EventQueueOperationsTimedOutCount",
5252
"kafka.controller:type=KafkaController,name=LastAppliedRecordLagMs",
@@ -194,7 +194,7 @@ public void testYammerTimeRatioIdleTimeTracking() {
194194
MetricsRegistry registry = new MetricsRegistry();
195195
MockTime time = new MockTime();
196196
try (QuorumControllerMetrics metrics = new QuorumControllerMetrics(Optional.of(registry), time, 9000)) {
197-
Gauge<Double> avgIdleRatio = (Gauge<Double>) registry.allMetrics().get(metricName("KafkaController", "AvgIdleRatio"));
197+
Gauge<Double> avgIdleRatio = (Gauge<Double>) registry.allMetrics().get(metricName("ControllerEventManager", "AvgIdleRatio"));
198198

199199
// No idle time recorded yet
200200
assertEquals(1.0, avgIdleRatio.value());

0 commit comments

Comments
 (0)