rdhabalia commented on a change in pull request #1185: Fixed storage latency 
stats with Prometheus
URL: https://github.com/apache/incubator-pulsar/pull/1185#discussion_r166206204
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java
 ##########
 @@ -64,24 +64,54 @@ public void reset() {
         entrySizeBuckets.reset();
     }
 
-    static void printNamespaceStats(SimpleTextOutputStream stream, String 
cluster, String namespace, String topic,
-        TopicStats stats) {
+    static void printTopicStats(SimpleTextOutputStream stream, String cluster, 
String namespace, String topic,
+            TopicStats stats) {
 
-        metric(stream, cluster, namespace, topic,"pulsar_subscriptions_count", 
stats.subscriptionsCount);
-        metric(stream, cluster, namespace, topic,"pulsar_producers_count", 
stats.producersCount);
-        metric(stream, cluster, namespace, topic,"pulsar_consumers_count", 
stats.consumersCount);
+        metric(stream, cluster, namespace, topic, 
"pulsar_subscriptions_count", stats.subscriptionsCount);
+        metric(stream, cluster, namespace, topic, "pulsar_producers_count", 
stats.producersCount);
+        metric(stream, cluster, namespace, topic, "pulsar_consumers_count", 
stats.consumersCount);
 
-        metric(stream, cluster, namespace, topic,"pulsar_rate_in", 
stats.rateIn);
-        metric(stream, cluster, namespace, topic,"pulsar_rate_out", 
stats.rateOut);
-        metric(stream, cluster, namespace, topic,"pulsar_throughput_in", 
stats.throughputIn);
-        metric(stream, cluster, namespace, topic,"pulsar_throughput_out", 
stats.throughputOut);
+        metric(stream, cluster, namespace, topic, "pulsar_rate_in", 
stats.rateIn);
+        metric(stream, cluster, namespace, topic, "pulsar_rate_out", 
stats.rateOut);
+        metric(stream, cluster, namespace, topic, "pulsar_throughput_in", 
stats.throughputIn);
+        metric(stream, cluster, namespace, topic, "pulsar_throughput_out", 
stats.throughputOut);
+
+        metric(stream, cluster, namespace, topic, "pulsar_storage_size", 
stats.storageSize);
+        metric(stream, cluster, namespace, topic, "pulsar_msg_backlog", 
stats.msgBacklog);
+
+        long[] latencyBuckets = stats.storageWriteLatencyBuckets.getBuckets();
+        metric(stream, cluster, namespace, topic, 
"pulsar_storage_write_latency_le_0_5", latencyBuckets[0]);
 
 Review comment:
   do we have any unit test which can cover this function. so, in future if we 
remove any bucket from 
[ML-bean](https://github.com/apache/incubator-pulsar/blob/master/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerMBeanImpl.java#L32)
 then unit-test can catch index-outofbound scenario.?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to