Search in sources :

Example 1 with LocalPNCounterStatsImpl

use of com.hazelcast.internal.monitor.impl.LocalPNCounterStatsImpl in project hazelcast by hazelcast.

the class AddOperation method updateStatistics.

/**
 * Updates the local PN counter statistics
 */
private void updateStatistics() {
    final PNCounterService service = getService();
    final LocalPNCounterStatsImpl stats = service.getLocalPNCounterStats(name);
    if (stats != null) {
        if (delta > 0) {
            stats.incrementIncrementOperationCount();
        } else if (delta < 0) {
            stats.incrementDecrementOperationCount();
        }
        stats.setValue(getBeforeUpdate ? (response.getValue() + delta) : response.getValue());
    }
}
Also used : LocalPNCounterStatsImpl(com.hazelcast.internal.monitor.impl.LocalPNCounterStatsImpl) PNCounterService(com.hazelcast.internal.crdt.pncounter.PNCounterService)

Aggregations

PNCounterService (com.hazelcast.internal.crdt.pncounter.PNCounterService)1 LocalPNCounterStatsImpl (com.hazelcast.internal.monitor.impl.LocalPNCounterStatsImpl)1