public static Metric metric(String name) {
        return MetricsImpl.metric(name, Unit.COUNT);
    }
@Test
    public void metricsAreRestartedIfPipelineIsRunTwice() {
        pipeline.readFrom(TestSources.items(0L, 1L, 2L, 3L, 4L))
                .filter(l -> {
                    Metrics.metric("total").increment();
                    return true;
                })
                .writeTo(Sinks.noop());

        Job job = runPipeline(pipeline.toDag());
        new JobMetricsChecker(job).assertSummedMetricValue("total", 5);
        job = runPipeline(pipeline.toDag());
        new JobMetricsChecker(job).assertSummedMetricValue("total", 5);
    }