asafm commented on code in PR #19047:
URL: https://github.com/apache/pulsar/pull/19047#discussion_r1059882189
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java:
##########
@@ -104,6 +115,9 @@ public static void generate(PulsarService pulsar, boolean
includeTopicMetrics, b
if (includeTopicMetrics) {
printTopicsCountStats(stream, localNamespaceTopicCount, cluster);
}
+
+ //Print broker level metrics to prometheus
Review Comment:
I would omit that comment line, as the method's name suffices here to
clarify the intent.
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java:
##########
@@ -310,11 +310,11 @@ public void testPerTopicStats() throws Exception {
assertEquals(cm.get(1).tags.get("namespace"), "my-property/use/my-ns");
cm = (List<Metric>) metrics.get("pulsar_producers_count");
- assertEquals(cm.size(), 3);
- assertEquals(cm.get(1).tags.get("topic"),
"persistent://my-property/use/my-ns/my-topic2");
+ assertEquals(cm.size(), 2);
Review Comment:
Well, if you're already here and adding new functionality (broker-level
metrics), I would advise adding a test to ensure it works and will never break.
Probably in a new method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]