You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "songxiaosheng (via GitHub)" <gi...@apache.org> on 2023/07/12 04:51:55 UTC

[GitHub] [dubbo] songxiaosheng commented on a diff in pull request #12714: Enhance metrics

songxiaosheng commented on code in PR #12714:
URL: https://github.com/apache/dubbo/pull/12714#discussion_r1260570422


##########
dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/AggregateMetricsCollector.java:
##########
@@ -196,7 +225,11 @@ private void collectMethod(List<MetricSample> list, String side, MetricsKey metr
 
     private void collectQPS(List<MetricSample> list) {
         qps.forEach((k, v) -> list.add(new GaugeMetricSample<>(MetricsKey.METRIC_QPS.getNameByType(k.getSide()),
-            MetricsKey.METRIC_QPS.getDescription(), k.getTags(), QPS, v, value -> value.get() / value.bucketLivedSeconds())));
+            MetricsKey.METRIC_QPS.getDescription(), k.getTags(), QPS, v, value -> {
+            double total = value.get();
+            long millSeconds = value.bucketLivedMillSeconds();
+            return total / millSeconds * 1000;

Review Comment:
   这里毫秒转秒要除以1000



##########
dubbo-common/src/main/java/org/apache/dubbo/config/nested/AggregationConfig.java:
##########
@@ -25,6 +25,14 @@ public class AggregationConfig implements Serializable {
      */
     private Boolean enabled;
 
+    private Boolean enableQPS;
+
+    private Boolean enableRTPXX;

Review Comment:
   这几个变量用驼峰命名会不会更合理



##########
dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/AggregateMetricsCollector.java:
##########
@@ -196,7 +225,11 @@ private void collectMethod(List<MetricSample> list, String side, MetricsKey metr
 
     private void collectQPS(List<MetricSample> list) {
         qps.forEach((k, v) -> list.add(new GaugeMetricSample<>(MetricsKey.METRIC_QPS.getNameByType(k.getSide()),
-            MetricsKey.METRIC_QPS.getDescription(), k.getTags(), QPS, v, value -> value.get() / value.bucketLivedSeconds())));
+            MetricsKey.METRIC_QPS.getDescription(), k.getTags(), QPS, v, value -> {
+            double total = value.get();
+            long millSeconds = value.bucketLivedMillSeconds();
+            return total / millSeconds * 1000;

Review Comment:
   这里毫秒转秒要除以1000



##########
dubbo-common/src/main/java/org/apache/dubbo/config/nested/AggregationConfig.java:
##########
@@ -25,6 +25,14 @@ public class AggregationConfig implements Serializable {
      */
     private Boolean enabled;
 
+    private Boolean enableQPS;
+
+    private Boolean enableRTPXX;

Review Comment:
   这几个变量用驼峰命名会不会更合理



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org