use of org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.NODE_METRICS_SYS_VIEW in project ignite by apache.
the class SystemViewSelfTest method testNodeMetrics.
/**
*/
@Test
public void testNodeMetrics() throws Exception {
long ts = U.currentTimeMillis();
try (IgniteEx ignite0 = startGrid(0);
IgniteEx ignite1 = startGrid(1)) {
awaitPartitionMapExchange();
SystemView<NodeMetricsView> view = ignite0.context().systemView().view(NODE_METRICS_SYS_VIEW);
assertEquals(2, view.size());
assertEquals(1, F.size(view.iterator(), row -> row.nodeId().equals(ignite0.cluster().localNode().id())));
assertEquals(1, F.size(view.iterator(), row -> row.nodeId().equals(ignite1.cluster().localNode().id())));
assertEquals(2, F.size(view.iterator(), row -> row.lastUpdateTime().getTime() >= ts));
}
}
Aggregations