use of org.apache.ignite.internal.processors.metric.GridMetricManager.CPU_LOAD_DESCRIPTION in project ignite by apache.
the class JmxExporterSpiTest method testSysJmxMetrics.
/**
*/
@Test
public void testSysJmxMetrics() throws Exception {
DynamicMBean sysMBean = metricRegistry(ignite.name(), null, SYS_METRICS);
Set<String> res = stream(sysMBean.getMBeanInfo().getAttributes()).map(MBeanFeatureInfo::getName).collect(toSet());
assertTrue(res.contains(CPU_LOAD));
assertTrue(res.contains(GC_CPU_LOAD));
assertTrue(res.contains(metricName("memory", "heap", "init")));
assertTrue(res.contains(metricName("memory", "heap", "used")));
assertTrue(res.contains(metricName("memory", "nonheap", "committed")));
assertTrue(res.contains(metricName("memory", "nonheap", "max")));
Optional<MBeanAttributeInfo> cpuLoad = stream(sysMBean.getMBeanInfo().getAttributes()).filter(a -> a.getName().equals(CPU_LOAD)).findFirst();
assertTrue(cpuLoad.isPresent());
assertEquals(CPU_LOAD_DESCRIPTION, cpuLoad.get().getDescription());
Optional<MBeanAttributeInfo> gcCpuLoad = stream(sysMBean.getMBeanInfo().getAttributes()).filter(a -> a.getName().equals(GC_CPU_LOAD)).findFirst();
assertTrue(gcCpuLoad.isPresent());
assertEquals(GC_CPU_LOAD_DESCRIPTION, gcCpuLoad.get().getDescription());
}
Aggregations