rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From duhengfore...@apache.org
Subject [rocketmq] branch develop updated: [statistics] Fix the inconsistency of putMessageDistributeTime statistics
Date Wed, 21 Jul 2021 01:14:37 GMT
This is an automated email from the ASF dual-hosted git repository.

duhengforever pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 25f6711  [statistics] Fix the inconsistency of putMessageDistributeTime statistics
     new 765cac3  Merge pull request #3025 from Git-Yang/statistics_bug
25f6711 is described below

commit 25f6711d7fd6fe0f00532a810b9fef7e81467b03
Author: zhangyang <Git_Yang@163.com>
AuthorDate: Mon Jun 21 20:42:29 2021 +0800

    [statistics] Fix the inconsistency of putMessageDistributeTime statistics
    
    Signed-off-by: zhangyang <Git_Yang@163.com>
---
 .../src/main/java/org/apache/rocketmq/store/StoreStatsService.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/store/src/main/java/org/apache/rocketmq/store/StoreStatsService.java b/store/src/main/java/org/apache/rocketmq/store/StoreStatsService.java
index d43b343..8372845 100644
--- a/store/src/main/java/org/apache/rocketmq/store/StoreStatsService.java
+++ b/store/src/main/java/org/apache/rocketmq/store/StoreStatsService.java
@@ -57,6 +57,7 @@ public class StoreStatsService extends ServiceThread {
     private final LinkedList<CallSnapshot> getTimesMissList = new LinkedList<CallSnapshot>();
     private final LinkedList<CallSnapshot> transferedMsgCountList = new LinkedList<CallSnapshot>();
     private volatile AtomicLong[] putMessageDistributeTime;
+    private volatile AtomicLong[] lastPutMessageDistributeTime;
     private long messageStoreBootTimestamp = System.currentTimeMillis();
     private volatile long putMessageEntireTimeMax = 0;
     private volatile long getMessageEntireTimeMax = 0;
@@ -80,11 +81,11 @@ public class StoreStatsService extends ServiceThread {
             next[i] = new AtomicLong(0);
         }
 
-        AtomicLong[] old = this.putMessageDistributeTime;
+        this.lastPutMessageDistributeTime = this.putMessageDistributeTime;
 
         this.putMessageDistributeTime = next;
 
-        return old;
+        return lastPutMessageDistributeTime;
     }
 
     public long getPutMessageEntireTimeMax() {
@@ -298,7 +299,7 @@ public class StoreStatsService extends ServiceThread {
     }
 
     private String putMessageDistributeTimeToString() {
-        final AtomicLong[] times = this.putMessageDistributeTime;
+        final AtomicLong[] times = this.lastPutMessageDistributeTime;
         if (null == times)
             return null;
 

Mime
View raw message