javeme commented on code in PR #2631:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2631#discussion_r1818098435


##########
hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/metrics/JRaftMetrics.java:
##########
@@ -172,35 +168,33 @@ private static void registerHistogram(String group, 
String name,
 
         String baseName = PREFIX + "." + name.toLowerCase();
 
-        HistogramWrapper wrapper = toWrapper(histogram);
-
-        Gauge.builder(baseName + ".median", wrapper, (d) -> 
d.getSnapshot().getMedian())
+        Gauge.builder(baseName + ".median", histogram, (d) -> 
d.getSnapshot().getMedian())
              .tags(tags).register(registry);
-        Gauge.builder(baseName + ".min", wrapper, (d) -> 
d.getSnapshot().getMin())
+        Gauge.builder(baseName + ".min", histogram, (d) -> 
d.getSnapshot().getMin())
              .tags(tags).register(registry);
-        Gauge.builder(baseName + ".max", wrapper, (d) -> 
d.getSnapshot().getMax())
+        Gauge.builder(baseName + ".max", histogram, (d) -> 
d.getSnapshot().getMax())

Review Comment:
   A further question, if each dimension like `min/max/mean` needs to be 
retrieved getSnapshot() once, does it need to be optimized?



##########
hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/metrics/JRaftMetrics.java:
##########
@@ -172,35 +168,33 @@ private static void registerHistogram(String group, 
String name,
 
         String baseName = PREFIX + "." + name.toLowerCase();
 
-        HistogramWrapper wrapper = toWrapper(histogram);
-
-        Gauge.builder(baseName + ".median", wrapper, (d) -> 
d.getSnapshot().getMedian())
+        Gauge.builder(baseName + ".median", histogram, (d) -> 
d.getSnapshot().getMedian())
              .tags(tags).register(registry);
-        Gauge.builder(baseName + ".min", wrapper, (d) -> 
d.getSnapshot().getMin())
+        Gauge.builder(baseName + ".min", histogram, (d) -> 
d.getSnapshot().getMin())

Review Comment:
   we can also rename "(d) ->" to "h ->"



##########
hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/metrics/JRaftMetrics.java:
##########
@@ -172,35 +168,33 @@ private static void registerHistogram(String group, 
String name,
 
         String baseName = PREFIX + "." + name.toLowerCase();
 
-        HistogramWrapper wrapper = toWrapper(histogram);
-
-        Gauge.builder(baseName + ".median", wrapper, (d) -> 
d.getSnapshot().getMedian())
+        Gauge.builder(baseName + ".median", histogram, (d) -> 
d.getSnapshot().getMedian())

Review Comment:
   ok



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to