use of com.hazelcast.monitor.impl.LocalQueueStatsImpl in project hazelcast by hazelcast.
the class ContainsOperation method afterRun.
@Override
public void afterRun() throws Exception {
LocalQueueStatsImpl stats = getQueueService().getLocalQueueStatsImpl(name);
stats.incrementOtherOperations();
}
use of com.hazelcast.monitor.impl.LocalQueueStatsImpl in project hazelcast by hazelcast.
the class OfferOperation method afterRun.
@Override
public void afterRun() throws Exception {
LocalQueueStatsImpl stats = getQueueService().getLocalQueueStatsImpl(name);
if (Boolean.TRUE.equals(response)) {
stats.incrementOffers();
publishEvent(ItemEventType.ADDED, data);
} else {
stats.incrementRejectedOffers();
}
}
use of com.hazelcast.monitor.impl.LocalQueueStatsImpl in project hazelcast by hazelcast.
the class QueueService method createLocalQueueStats.
/**
* Returns the local queue statistics for the given name and partition ID. If this node is the owner for the partition,
* returned stats contain {@link LocalQueueStats#getOwnedItemCount()}, otherwise it contains
* {@link LocalQueueStats#getBackupItemCount()}.
*
* @param name the name of the queue for which the statistics are returned
* @param partitionId the partition ID for which the statistics are returned
* @return the statistics
*/
public LocalQueueStats createLocalQueueStats(String name, int partitionId) {
LocalQueueStatsImpl stats = getLocalQueueStatsImpl(name);
stats.setOwnedItemCount(0);
stats.setBackupItemCount(0);
QueueContainer container = containerMap.get(name);
if (container == null) {
return stats;
}
Address thisAddress = nodeEngine.getClusterService().getThisAddress();
IPartition partition = nodeEngine.getPartitionService().getPartition(partitionId);
Address owner = partition.getOwnerOrNull();
if (thisAddress.equals(owner)) {
stats.setOwnedItemCount(container.size());
} else if (owner != null) {
stats.setBackupItemCount(container.backupSize());
}
container.setStats(stats);
return stats;
}
use of com.hazelcast.monitor.impl.LocalQueueStatsImpl in project hazelcast by hazelcast.
the class PeekOperation method afterRun.
@Override
public void afterRun() throws Exception {
LocalQueueStatsImpl stats = getQueueService().getLocalQueueStatsImpl(name);
stats.incrementOtherOperations();
}
use of com.hazelcast.monitor.impl.LocalQueueStatsImpl in project hazelcast by hazelcast.
the class PollOperation method afterRun.
@Override
public void afterRun() throws Exception {
LocalQueueStatsImpl stats = getQueueService().getLocalQueueStatsImpl(name);
if (response != null) {
stats.incrementPolls();
publishEvent(ItemEventType.REMOVED, item.getData());
} else {
stats.incrementEmptyPolls();
}
}
Aggregations