Skip to content

Commit

Permalink
fix: use ConcurrentHashMap instead of HashMap (#856)
Browse files Browse the repository at this point in the history
Close: #847
  • Loading branch information
sdelamo authored Oct 29, 2024
1 parent 3541062 commit bb95485
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Holds metadata about metric options to apply
* Holds metadata about metric options to apply.
*
* @author Haiden Rothwell
* @since 5.6.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import jakarta.inject.Singleton;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import static io.micronaut.configuration.metrics.micrometer.MeterRegistryFactory.MICRONAUT_METRICS_BINDERS;

Expand All @@ -46,7 +46,7 @@ public class RetryMetricsBinder implements RetryEventListener {
public static final String RETRY_METRICS_ENABLED = MICRONAUT_METRICS_BINDERS + ".retry.enabled";
private static final Logger LOGGER = LoggerFactory.getLogger(RetryMetricsBinder.class);
private final BeanProvider<MeterRegistry> meterRegistryProvider;
private final HashMap<ExecutableMethod<?, ?>, Counter> attemptCounters = new HashMap<>();
private final Map<ExecutableMethod<?, ?>, Counter> attemptCounters = new ConcurrentHashMap<>();

/**
* @param meterRegistryProvider The meter registry provider
Expand Down

0 comments on commit bb95485

Please sign in to comment.