You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "mxsm (via GitHub)" <gi...@apache.org> on 2023/03/07 13:11:50 UTC

[GitHub] [incubator-eventmesh] mxsm commented on a diff in pull request #3362: ISSUE #3252 : Field may be final in HttpSummaryMetrics

mxsm commented on code in PR #3362:
URL: https://github.com/apache/incubator-eventmesh/pull/3362#discussion_r1127830621


##########
eventmesh-metrics-plugin/eventmesh-metrics-api/src/main/java/org/apache/eventmesh/metrics/api/model/HttpSummaryMetrics.java:
##########
@@ -120,20 +120,20 @@ public float avgHTTPBodyDecodeCost() {
         return (httpDecodeNum.longValue() == 0L) ? 0f : httpDecodeTimeCost / httpDecodeNum.longValue();
     }
 
-    private AtomicLong sendBatchMsgNumPerSecond = new AtomicLong(0);
+    private final AtomicLong sendBatchMsgNumPerSecond = new AtomicLong(0);
 
-    private AtomicLong sendBatchMsgNumSum = new AtomicLong(0);
+    private final AtomicLong sendBatchMsgNumSum = new AtomicLong(0);
 
-    private AtomicLong sendBatchMsgFailNumSum = new AtomicLong(0);
+    private final AtomicLong sendBatchMsgFailNumSum = new AtomicLong(0);
 
     // This is a cumulative value
-    private AtomicLong sendBatchMsgDiscardNumSum = new AtomicLong(0);
+    private final AtomicLong sendBatchMsgDiscardNumSum = new AtomicLong(0);
 
     public void recordSendBatchMsgDiscard(long delta) {
         sendBatchMsgDiscardNumSum.addAndGet(delta);
     }
 

Review Comment:
   Adjust the position of variables, move them to the beginning of the file class, and place the methods below the variables.



-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org