Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ConcurrentHashMap instead of HashMap #856

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading