TimeMetricLevelFilter implements MetricFilter { @Override public boolean matches(MetricName name, Metric metric) { if (config == null) { return true; } return levelInfos[name.getMetricLevel().ordinal()].allow; } TimeMetricLevelFilter();  TimeMetricLevelFilter(MetricsCollectPeriodConfig config); void beforeReport(); void afterReport(); @Override boolean matches(MetricName name, Metric metric);  }
@Test public void testNull() throws InterruptedException { TimeMetricLevelFilter filter = new TimeMetricLevelFilter(null); MetricName name = new MetricName("test", MetricLevel.NORMAL); Assert.assertTrue(filter.matches(name, null)); TimeUnit.SECONDS.sleep(2); Assert.assertTrue(filter.matches(name, null)); }