use of com.hotels.styx.api.MeterRegistry in project styx by ExpediaGroup.
the class CoreMetricsTest method registersOperatingSystemMetrics.
@Test
public void registersOperatingSystemMetrics() {
MeterRegistry registry = new MicrometerRegistry(new SimpleMeterRegistry());
CoreMetricsKt.registerCoreMetrics(new CentralisedMetrics(registry));
List<String> gauges = registry.getMeters().stream().map(meter -> meter.getId().getName()).collect(Collectors.toList());
assertThat(gauges, hasItems("os.process.cpu.load", "os.process.cpu.time", "os.system.cpu.load", "os.memory.physical.free", "os.memory.physical.total", "os.memory.virtual.committed", "os.swapSpace.free", "os.swapSpace.total"));
}
use of com.hotels.styx.api.MeterRegistry in project styx by ExpediaGroup.
the class CoreMetricsTest method registersJvmMetrics.
@Test
public void registersJvmMetrics() {
MeterRegistry registry = new MicrometerRegistry(new SimpleMeterRegistry());
CoreMetricsKt.registerCoreMetrics(new CentralisedMetrics(registry));
assertThat(registry.find("jvm.uptime").gauges(), hasSize(1));
assertThat(registry.find("proxy.netty.buffers.memory").tags("allocator", "pooled", "memoryType", "direct").gauges(), hasSize(1));
assertThat(registry.find("proxy.netty.buffers.memory").tags("allocator", "pooled", "memoryType", "heap").gauges(), hasSize(1));
assertThat(registry.find("proxy.netty.buffers.memory").tags("allocator", "unpooled", "memoryType", "direct").gauges(), hasSize(1));
assertThat(registry.find("proxy.netty.buffers.memory").tags("allocator", "unpooled", "memoryType", "heap").gauges(), hasSize(1));
}
Aggregations