Nova { public static Builder builder() { return new Builder(); } private  Nova(Builder builder); static Builder builder(); final String identifier; final EventBus eventBus; final Filesystem filesystem; final Metrics metrics; }
@Test void jvmMetricsAreCapturedByDefault() { Nova sut = Nova.builder().build(); MetricsDump metricsDump = sut.metrics.dump(); assertTrue(metricsDump.metrics.get(Metrics.name("jvm.mem")) instanceof MemoryMeter); assertTrue(metricsDump.metrics.get(Metrics.name("jvm.gc")) instanceof GarbageCollectionMeter); }
@Test void jvmMetricsCapturingCanBeSwitchedOff() { Nova sut = Nova.builder().captureJvmMetrics(false).build(); MetricsDump metricsDump = sut.metrics.dump(); assertNull(metricsDump.metrics.get(Metrics.name("jvm.mem"))); assertNull(metricsDump.metrics.get(Metrics.name("jvm.gc"))); }