mirror of
https://github.com/google/nomulus.git
synced 2025-07-22 10:46:10 +02:00
Add a convenience method to clear all registered metrics
Also making these methods public so that other test methods can use them. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=174074038
This commit is contained in:
parent
b0e062d725
commit
d3254eaaeb
2 changed files with 11 additions and 12 deletions
|
@ -37,19 +37,14 @@ import org.junit.runners.JUnit4;
|
|||
@RunWith(JUnit4.class)
|
||||
public class MetricRegistryImplTest {
|
||||
|
||||
@Rule
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final LabelDescriptor label =
|
||||
LabelDescriptor.create("test_labelname", "test_labeldescription");
|
||||
|
||||
@After
|
||||
public void clearMetrics() {
|
||||
ImmutableList<Metric<?>> metrics = MetricRegistryImpl.getDefault().getRegisteredMetrics();
|
||||
|
||||
for (Metric<?> metric : metrics) {
|
||||
MetricRegistryImpl.getDefault().unregisterMetric(metric.getMetricSchema().name());
|
||||
}
|
||||
MetricRegistryImpl.getDefault().unregisterAllMetrics();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue