Mmuzaf commented on code in PR #2832:
URL: https://github.com/apache/cassandra/pull/2832#discussion_r1371763077
##########
src/java/org/apache/cassandra/metrics/RepairMetrics.java:
##########
@@ -18,17 +18,41 @@
package org.apache.cassandra.metrics;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.Map;
+
import com.codahale.metrics.Counter;
+import com.codahale.metrics.Histogram;
+import org.apache.cassandra.net.Verb;
import static org.apache.cassandra.metrics.CassandraMetricsRegistry.Metrics;
public class RepairMetrics
{
public static final String TYPE_NAME = "Repair";
public static final Counter previewFailures =
Metrics.counter(DefaultNameFactory.createMetricName(TYPE_NAME,
"PreviewFailures", null));
+ private static final Histogram retries =
Metrics.histogram(DefaultNameFactory.createMetricName(TYPE_NAME, "Retries",
null), false);
+ private static final Map<Verb, Histogram> retriesByVerb =
Collections.synchronizedMap(new EnumMap<>(Verb.class));
Review Comment:
@dcapwell My bad. I should have checked the `SynchronizedMap`
implementation, not the `Map` interface itself, so you are right :-) How much
RAM are we trying to save? I'm still concerned that we add the synchronized map
to the hotpath, as my understanding is that metrics calculation should have no
impact on the message processing as it is less important to the process itself.
This is anyway unrelated to the latest changes :-)
--
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]