public static Metric metric(String name) {
        return MetricsImpl.metric(name, Unit.COUNT);
    }
@Test
    public void when_metricsDisabled_then_unavailableDuringJobExecution() {
        int generatedItems = 1000;

        pipeline.readFrom(TestSources.itemStream(1_000))
                .withIngestionTimestamps()
                .filter(l -> l.sequence() < generatedItems)
                .map(t -> {
                    Metrics.metric("total").increment();
                    return t;
                })
                .writeTo(Sinks.list("sink"));

        Job job = instance.getJet().newJob(pipeline, new JobConfig().setMetricsEnabled(false));
        List<Object> list = instance.getList("sink");
        assertTrueEventually(() -> assertFalse(list.isEmpty()));
        assertTrue(job.getMetrics().get("total").isEmpty());
    }