songxiaosheng commented on code in PR #11628:
URL: https://github.com/apache/dubbo/pull/11628#discussion_r1114409890
##########
dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/sample/SimpleMetricsCountSampler.java:
##########
@@ -38,124 +43,120 @@
public abstract class SimpleMetricsCountSampler<S, K, M extends Metric>
implements MetricsCountSampler<S, K, M> {
- private final ConcurrentMap<M, AtomicLong> lastRT = new
ConcurrentHashMap<>();
- private final ConcurrentMap<M, LongAccumulator> minRT = new
ConcurrentHashMap<>();
- private final ConcurrentMap<M, LongAccumulator> maxRT = new
ConcurrentHashMap<>();
- private final ConcurrentMap<M, AtomicLong> avgRT = new
ConcurrentHashMap<>();
- private final ConcurrentMap<M, AtomicLong> totalRT = new
ConcurrentHashMap<>();
- private final ConcurrentMap<M, AtomicLong> rtCount = new
ConcurrentHashMap<>();
+ private final ConcurrentMap<M, AtomicLong> EMPTY_COUNT = new
ConcurrentHashMap<>();
- private Map<K, ConcurrentMap<M, AtomicLong>> metricCounter = new
ConcurrentHashMap<>();
+ private final ConcurrentMap<M, LongAccumulator> minRT = new
ConcurrentHashMap<>();
+ private final ConcurrentMap<M, LongAccumulator> maxRT = new
ConcurrentHashMap<>();
+
+ // lastRT, totalRT, rtCount, avgRT share a container, can utilize the
system cache line
+ private final ConcurrentMap<M, AtomicLongArray> RTArray = new
ConcurrentHashMap<>();
Review Comment:
Please change the first name to lowercase
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]