mirror of
https://github.com/apache/rocketmq.git
synced 2026-10-29 17:25:35 +08:00
Merge pull request #3025 from Git-Yang/statistics_bug
[ISSUE #3023] Fix the inconsistency of putMessageDistributeTime statistics
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user