public CumulativeStats toCumulativeStats() {
        CumulativeStats cumulativeStats = new CumulativeStats();
        cumulativeStats.totalMessagesSent = totalMessagesSent.sum();
        cumulativeStats.totalMessagesSendFailed = totalMessagesSendFailed.sum();
        cumulativeStats.totalBytesSent = totalBytesSent.sum();
        cumulativeStats.totalMessagesReceived = totalMessagesReceived.sum();
        cumulativeStats.totalBytesReceived = totalBytesReceived.sum();
        cumulativeStats.totalSendLatencyMicros = totalSendLatencyMicros.copy();
        cumulativeStats.totalEndToEndLatencyMicros = totalEndToEndLatencyMicros.copy();
        return cumulativeStats;
    }
Get cumulative stats.
Note: There is no side effect on any counters.
tools/src/main/java/org/apache/kafka/tools/automq/perf/Stats.java