@Override
    public void run(DiagnosticsLogWriter writer) {
        metricCollector.writer = writer;
        // we set the time explicitly so that for this particular rendering of the probes, all metrics have exactly
        // the same timestamp
        metricCollector.timeMillis = System.currentTimeMillis();
        metricsRegistry.collect(metricCollector);
        metricCollector.writer = null;
    }
@Test
    public void testExclusion() {
        metricsRegistry.registerStaticMetrics(new ExclusionProbeSource(), "test");

        plugin.run(logWriter);

        assertContains("[unit=count,metric=test.notExcludedLong]=1");
        assertNotContains("[unit=count,metric=test.excludedLong]=1");
        assertContains("[unit=count,metric=test.notExcludedDouble]=1.5");
        assertNotContains("[unit=count,metric=test.excludedDouble]=2.5");
    }