Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cleanup][monitor] Remove metric topic_load_times #21167

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class BrokerOperabilityMetrics {
private static final Counter TOPIC_LOAD_FAILED = Counter.build("topic_load_failed", "-").register();
private final List<Metrics> metricsList;
private final String localCluster;
private final DimensionStats oldTopicLoadStats;
private final DimensionStats topicLoadStats;
private final String brokerName;
private final LongAdder connectionTotalCreatedCount;
Expand All @@ -45,7 +44,6 @@ public class BrokerOperabilityMetrics {
public BrokerOperabilityMetrics(String localCluster, String brokerName) {
this.metricsList = new ArrayList<>();
this.localCluster = localCluster;
this.oldTopicLoadStats = new DimensionStats("topic_load_times", 60);
this.topicLoadStats = new DimensionStats("pulsar_topic_load_times", 60);
this.brokerName = brokerName;
this.connectionTotalCreatedCount = new LongAdder();
Expand All @@ -61,7 +59,6 @@ public List<Metrics> getMetrics() {
}

private void generate() {
metricsList.add(getOldTopicLoadMetrics());
metricsList.add(getTopicLoadMetrics());
metricsList.add(getConnectionMetrics());
}
Expand All @@ -88,11 +85,6 @@ Map<String, String> getDimensionMap(String metricsName) {
return dimensionMap;
}

Metrics getOldTopicLoadMetrics() {
Metrics metrics = getDimensionMetrics("topic_load_times", "topic_load", oldTopicLoadStats);
return metrics;
}

Metrics getTopicLoadMetrics() {
Metrics metrics = getDimensionMetrics("pulsar_topic_load_times", "topic_load", topicLoadStats);
metrics.put("brk_topic_load_failed_count", TOPIC_LOAD_FAILED.get());
Expand All @@ -117,12 +109,10 @@ Metrics getDimensionMetrics(String metricsName, String dimensionName, DimensionS

public void reset() {
metricsList.clear();
oldTopicLoadStats.reset();
topicLoadStats.reset();
}

public void recordTopicLoadTimeValue(long topicLoadLatencyMs) {
oldTopicLoadStats.recordDimensionTimeValue(topicLoadLatencyMs, TimeUnit.MILLISECONDS);
topicLoadStats.recordDimensionTimeValue(topicLoadLatencyMs, TimeUnit.MILLISECONDS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ public void testMetricsTopicCount() throws Exception {
assertEquals(item.value, 3.0);
}
});
Collection<Metric> topicLoadTimesMetrics = metrics.get("topic_load_times");
Collection<Metric> topicLoadTimesCountMetrics = metrics.get("topic_load_times_count");
assertEquals(topicLoadTimesMetrics.size(), 6);
assertEquals(topicLoadTimesCountMetrics.size(), 1);
Collection<Metric> pulsarTopicLoadTimesMetrics = metrics.get("pulsar_topic_load_times");
Collection<Metric> pulsarTopicLoadTimesCountMetrics = metrics.get("pulsar_topic_load_times_count");
assertEquals(pulsarTopicLoadTimesMetrics.size(), 6);
Expand Down Expand Up @@ -338,7 +334,7 @@ public void testPerTopicStats() throws Exception {
assertEquals(cm.get(1).tags.get("topic"), "persistent://my-property/use/my-ns/my-topic1");
assertEquals(cm.get(1).tags.get("namespace"), "my-property/use/my-ns");

cm = (List<Metric>) metrics.get("topic_load_times_count");
cm = (List<Metric>) metrics.get("pulsar_topic_load_times_count");
assertEquals(cm.size(), 1);
assertEquals(cm.get(0).tags.get("cluster"), "test");

Expand Down
Loading