use of org.apache.ignite.internal.managers.discovery.IgniteClusterNode in project ignite by apache.
the class CacheMetricsForClusterGroupSelfTest method testMetricsDiscoveryUpdatesDisabled.
/**
* Tests that only local metrics are updating if discovery updates disabled.
*/
@Test
public void testMetricsDiscoveryUpdatesDisabled() throws Exception {
System.setProperty(IgniteSystemProperties.IGNITE_DISCOVERY_DISABLE_CACHE_METRICS_UPDATE, "true");
try {
startGrids();
try {
createCaches(true);
populateCacheData(cache1, ENTRY_CNT_CACHE1);
populateCacheData(cache2, ENTRY_CNT_CACHE2);
readCacheData(cache1, ENTRY_CNT_CACHE1);
readCacheData(cache2, ENTRY_CNT_CACHE2);
awaitMetricsUpdate(1);
Collection<ClusterNode> nodes = grid(0).cluster().forRemotes().nodes();
for (ClusterNode node : nodes) {
Map<Integer, CacheMetrics> metrics = ((IgniteClusterNode) node).cacheMetrics();
assertNotNull(metrics);
assertTrue(metrics.isEmpty());
}
assertOnlyLocalMetricsUpdating(CACHE1);
assertOnlyLocalMetricsUpdating(CACHE2);
} finally {
stopAllGrids();
}
} finally {
System.setProperty(IgniteSystemProperties.IGNITE_DISCOVERY_DISABLE_CACHE_METRICS_UPDATE, "false");
}
}
Aggregations