use of com.hazelcast.topic.LocalTopicStats in project hazelcast by hazelcast.
the class ReliableTopicService method getStats.
@Override
public Map<String, LocalTopicStats> getStats() {
Map<String, LocalTopicStats> topicStats = MapUtil.createHashMap(statsMap.size());
Config config = nodeEngine.getConfig();
for (Map.Entry<String, LocalTopicStatsImpl> queueStat : statsMap.entrySet()) {
String name = queueStat.getKey();
if (config.getReliableTopicConfig(name).isStatisticsEnabled()) {
topicStats.put(name, queueStat.getValue());
}
}
return topicStats;
}
use of com.hazelcast.topic.LocalTopicStats in project hazelcast by hazelcast.
the class TopicService method getStats.
@Override
public Map<String, LocalTopicStats> getStats() {
Map<String, LocalTopicStats> topicStats = MapUtil.createHashMap(statsMap.size());
Config config = nodeEngine.getConfig();
for (Map.Entry<String, LocalTopicStatsImpl> statEntry : statsMap.entrySet()) {
String name = statEntry.getKey();
if (config.getTopicConfig(name).isStatisticsEnabled()) {
topicStats.put(name, statEntry.getValue());
}
}
return topicStats;
}
use of com.hazelcast.topic.LocalTopicStats in project Payara by payara.
the class EventBus method collect.
@Override
public void collect(MonitoringDataCollector rootCollector) {
MonitoringDataCollector eventCollector = rootCollector.in("topic");
if (hzCore.isEnabled()) {
HazelcastInstance hz = hzCore.getInstance();
for (DistributedObject obj : hz.getDistributedObjects()) {
if (TopicService.SERVICE_NAME.equals(obj.getServiceName())) {
LocalTopicStats stats = hz.getTopic(obj.getName()).getLocalTopicStats();
eventCollector.group(obj.getName()).collect("PublishedCount", stats.getPublishOperationCount()).collect("ReceiveedCount", stats.getReceiveOperationCount());
}
}
}
}
use of com.hazelcast.topic.LocalTopicStats in project hazelcast by hazelcast.
the class ReliableTopicMBeanTest method testAttributesAndOperations.
@Test
public void testAttributesAndOperations() throws Exception {
reliableTopic.publish("test");
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
LocalTopicStats topicStats = reliableTopic.getLocalTopicStats();
long localCreationTime = getLongAttribute("localCreationTime");
long localPublishOperationCount = getLongAttribute("localPublishOperationCount");
long localReceiveOperationCount = getLongAttribute("localReceiveOperationCount");
assertEquals(topicStats.getCreationTime(), localCreationTime);
assertEquals(topicStats.getPublishOperationCount(), localPublishOperationCount);
assertEquals(topicStats.getReceiveOperationCount(), localReceiveOperationCount);
}
});
}
Aggregations