3030/**
3131 */
3232public class BrokerOperabilityMetrics {
33- private final Counter TOPIC_LOAD_FAILED = Counter . build ( "topic_load_failed" , "-" ). register () ;
33+ private final Counter topicLoadFailedCount ;
3434 private final List <Metrics > metricsList ;
3535 private final String localCluster ;
3636 private final DimensionStats topicLoadStats ;
@@ -45,6 +45,7 @@ public BrokerOperabilityMetrics(String localCluster, String brokerName) {
4545 this .metricsList = new ArrayList <>();
4646 this .localCluster = localCluster ;
4747 this .topicLoadStats = new DimensionStats ("topic_load_times" , 60 );
48+ this .topicLoadFailedCount = Counter .build ("topic_load_failed" , "-" ).register ();
4849 this .brokerName = brokerName ;
4950 this .connectionTotalCreatedCount = new LongAdder ();
5051 this .connectionCreateSuccessCount = new LongAdder ();
@@ -87,7 +88,7 @@ Map<String, String> getDimensionMap(String metricsName) {
8788
8889 Metrics getTopicLoadMetrics () {
8990 Metrics metrics = getDimensionMetrics ("topic_load_times" , "topic_load" , topicLoadStats );
90- metrics .put ("brk_topic_load_failed_count" , TOPIC_LOAD_FAILED .get ());
91+ metrics .put ("brk_topic_load_failed_count" , topicLoadFailedCount .get ());
9192 return metrics ;
9293 }
9394
@@ -117,7 +118,7 @@ public void recordTopicLoadTimeValue(long topicLoadLatencyMs) {
117118 }
118119
119120 public void recordTopicLoadFailed () {
120- this .TOPIC_LOAD_FAILED .inc ();
121+ this .topicLoadFailedCount .inc ();
121122 }
122123
123124 public void recordConnectionCreate () {
0 commit comments