use of com.hazelcast.spi.StatisticsAwareService in project hazelcast by hazelcast.
the class TimedMemberStateFactory method createMemState.
private void createMemState(TimedMemberState timedMemberState, MemberStateImpl memberState, Collection<StatisticsAwareService> services) {
int count = 0;
Config config = instance.getConfig();
Set<String> longInstanceNames = new HashSet<String>(maxVisibleInstanceCount);
for (StatisticsAwareService service : services) {
if (count < maxVisibleInstanceCount) {
if (service instanceof MapService) {
count = handleMap(memberState, count, config, ((MapService) service).getStats(), longInstanceNames);
} else if (service instanceof MultiMapService) {
count = handleMultimap(memberState, count, config, ((MultiMapService) service).getStats(), longInstanceNames);
} else if (service instanceof QueueService) {
count = handleQueue(memberState, count, config, ((QueueService) service).getStats(), longInstanceNames);
} else if (service instanceof TopicService) {
count = handleTopic(memberState, count, config, ((TopicService) service).getStats(), longInstanceNames);
} else if (service instanceof DistributedExecutorService) {
count = handleExecutorService(memberState, count, config, ((DistributedExecutorService) service).getStats(), longInstanceNames);
} else if (service instanceof ReplicatedMapService) {
count = handleReplicatedMap(memberState, count, config, ((ReplicatedMapService) service).getStats(), longInstanceNames);
}
}
}
WanReplicationService wanReplicationService = instance.node.nodeEngine.getWanReplicationService();
Map<String, LocalWanStats> wanStats = wanReplicationService.getStats();
if (wanStats != null) {
count = handleWan(memberState, count, wanStats, longInstanceNames);
}
if (cacheServiceEnabled) {
ICacheService cacheService = getCacheService();
for (CacheConfig cacheConfig : cacheService.getCacheConfigs()) {
if (cacheConfig.isStatisticsEnabled() && count < maxVisibleInstanceCount) {
CacheStatistics statistics = cacheService.getStatistics(cacheConfig.getNameWithPrefix());
//is filled.git
if (statistics != null) {
count = handleCache(memberState, count, cacheConfig, statistics, longInstanceNames);
}
}
}
}
timedMemberState.setInstanceNames(longInstanceNames);
}
Aggregations