use of com.hazelcast.internal.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.internal.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.internal.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 = partitionService.getPartition(partitionId, false);
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.internal.monitor.impl.LocalQueueStatsImpl in project hazelcast by hazelcast.
the class DrainOperation method afterRun.
@Override
public void afterRun() throws Exception {
LocalQueueStatsImpl stats = getQueueService().getLocalQueueStatsImpl(name);
stats.incrementOtherOperations();
for (Data data : dataMap.values()) {
publishEvent(ItemEventType.REMOVED, data);
}
}
use of com.hazelcast.internal.monitor.impl.LocalQueueStatsImpl in project hazelcast by hazelcast.
the class IteratorOperation method afterRun.
@Override
public void afterRun() throws Exception {
LocalQueueStatsImpl stats = getQueueService().getLocalQueueStatsImpl(name);
stats.incrementOtherOperations();
}
Aggregations