dcapwell commented on code in PR #2832:
URL: https://github.com/apache/cassandra/pull/2832#discussion_r1372064606
##########
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:
> I'm still concerned that we add the synchronized map to the hotpath
this isn't the hot path, this is retry messaging on the network thread...
this is def the slow path =D
Also, your other feedback to preallocate avoids this problem as its now an
immutable map...
--
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]