3030/**
3131 */
3232public class BrokerOperabilityMetrics {
33+ private static final Counter TOPIC_LOAD_FAILED = Counter .build ("topic_load_failed" , "-" ).register ();
3334 private final List <Metrics > metricsList ;
3435 private final String localCluster ;
3536 private final DimensionStats topicLoadStats ;
@@ -39,7 +40,6 @@ public class BrokerOperabilityMetrics {
3940 private final LongAdder connectionCreateFailCount ;
4041 private final LongAdder connectionTotalClosedCount ;
4142 private final LongAdder connectionActive ;
42- private static final Counter topicLoadFailed = Counter .build ("topic_load_failed" , "-" ).register ();
4343
4444 public BrokerOperabilityMetrics (String localCluster , String brokerName ) {
4545 this .metricsList = new ArrayList <>();
@@ -87,7 +87,7 @@ Map<String, String> getDimensionMap(String metricsName) {
8787
8888 Metrics getTopicLoadMetrics () {
8989 Metrics metrics = getDimensionMetrics ("topic_load_times" , "topic_load" , topicLoadStats );
90- metrics .put ("brk_topic_load_failed_count" , topicLoadFailed .get ());
90+ metrics .put ("brk_topic_load_failed_count" , TOPIC_LOAD_FAILED .get ());
9191 return metrics ;
9292 }
9393
@@ -117,7 +117,7 @@ public void recordTopicLoadTimeValue(long topicLoadLatencyMs) {
117117 }
118118
119119 public void recordTopicLoadFailed () {
120- this .topicLoadFailed .inc ();
120+ this .TOPIC_LOAD_FAILED .inc ();
121121 }
122122
123123 public void recordConnectionCreate () {
0 commit comments