### Question:
SystemMetrics extends AbstractLifecycleListener { public SystemMetrics() { this(new File("/proc/meminfo")); } SystemMetrics();   SystemMetrics(File memInfoFile); @Override void start(ElasticApmTracer tracer);  }### Answer:
@Test @DisabledOnOs(OS.MAC) void testSystemMetrics() throws InterruptedException { systemMetrics.bindTo(metricRegistry); consumeCpu(); Thread.sleep(1000); assertThat(metricRegistry.getGaugeValue("system.cpu.total.norm.pct", Labels.EMPTY)).isBetween(0.0, 1.0); assertThat(metricRegistry.getGaugeValue("system.process.cpu.total.norm.pct", Labels.EMPTY)).isBetween(0.0, 1.0); assertThat(metricRegistry.getGaugeValue("system.memory.total", Labels.EMPTY)).isGreaterThan(0.0); assertThat(metricRegistry.getGaugeValue("system.memory.actual.free", Labels.EMPTY)).isGreaterThan(0.0); assertThat(metricRegistry.getGaugeValue("system.process.memory.size", Labels.EMPTY)).isGreaterThan(0.0); }