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

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

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


##########
dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/AggregateMetricsCollector.java:
##########
@@ -78,8 +85,16 @@ public AggregateMetricsCollector(ApplicationModel applicationModel) {
             if (optional.isPresent()) {
                 registerListener();
                 AggregationConfig aggregation = optional.get().getAggregation();
-                this.bucketNum = aggregation.getBucketNum() == null ? DEFAULT_BUCKET_NUM : aggregation.getBucketNum();
-                this.timeWindowSeconds = aggregation.getTimeWindowSeconds() == null ? DEFAULT_TIME_WINDOW_SECONDS : aggregation.getTimeWindowSeconds();
+                this.bucketNum = aggregation.getBucketNum() == null ?
+                    DEFAULT_BUCKET_NUM : aggregation.getBucketNum();
+                this.timeWindowSeconds = aggregation.getTimeWindowSeconds() == null ?
+                    DEFAULT_TIME_WINDOW_SECONDS : aggregation.getTimeWindowSeconds();
+                this.qpsTimeWindowMillSeconds = aggregation.getQpsTimeWindowMillSeconds() == null ?
+                    DEFAULT_QPS_TIME_WINDOW_MILL_SECONDS : aggregation.getQpsTimeWindowMillSeconds();
+                this.enableQps = aggregation.getEnableQps() == null || aggregation.getEnableQps();
+                this.enableRtPxx = aggregation.getEnableRtPxx() == null || aggregation.getEnableRtPxx();
+                this.enableRt = aggregation.getEnableRt() == null || aggregation.getEnableRt();
+                this.enableRequest = aggregation.getEnableRequest() == null || aggregation.getEnableRequest();
             }

Review Comment:
   Maybe it could be written more cohesive
   public boolean getEnableQps() {
           return Optional.ofNullable(enableQps).orElse(true);
       }



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