mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02: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:
parent
f59c3daf6d
commit
0573560a6c
1 changed files with 8 additions and 1 deletions
|
@ -36,7 +36,14 @@ public final class MetricRegistryImpl implements MetricRegistry {
|
||||||
/** The canonical registry for metrics. The map key is the metric name. */
|
/** The canonical registry for metrics. The map key is the metric name. */
|
||||||
private final ConcurrentHashMap<String, Metric<?>> registeredMetrics = new ConcurrentHashMap<>();
|
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() {
|
public static MetricRegistryImpl getDefault() {
|
||||||
return INSTANCE;
|
return INSTANCE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue