mirror of
https://github.com/google/nomulus
synced 2026-01-09 15:43:52 +00:00
Change MetricsRegistryImpl constructor to "@VisibleForTesting public".
This enables registry isolation in tests. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=173426040
This commit is contained in:
@@ -36,7 +36,14 @@ public final class MetricRegistryImpl implements MetricRegistry {
|
||||
/** The canonical registry for metrics. The map key is the metric name. */
|
||||
private final ConcurrentHashMap<String, Metric<?>> registeredMetrics = new ConcurrentHashMap<>();
|
||||
|
||||
private MetricRegistryImpl() {}
|
||||
|
||||
/**
|
||||
* Production code must use {@link getDefault}, since this returns the {@link MetricRegistry}
|
||||
* that {@link MetricReporter} uses. Test code that does not use {@link MetricReporter} can
|
||||
* use this constructor to get an isolated instance of the registry.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public MetricRegistryImpl() {}
|
||||
|
||||
public static MetricRegistryImpl getDefault() {
|
||||
return INSTANCE;
|
||||
|
||||
Reference in New Issue
Block a user