Search in sources :

Example 1 with LocalMapStatsImpl

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

the class LocalMapStatsProvider method createLocalMapStats.

public LocalMapStatsImpl createLocalMapStats(String mapName) {
    LocalMapStatsImpl stats = getLocalMapStatsImpl(mapName);
    LocalMapOnDemandCalculatedStats onDemandStats = new LocalMapOnDemandCalculatedStats();
    addNearCacheStats(mapName, stats, onDemandStats);
    addIndexStats(mapName, stats);
    updateMapOnDemandStats(mapName, onDemandStats);
    return onDemandStats.updateAndGet(stats);
}
Also used : LocalMapStatsImpl(com.hazelcast.internal.monitor.impl.LocalMapStatsImpl)

Example 2 with LocalMapStatsImpl

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

the class MultiMapEntrySetMessageTask method reduce.

@Override
protected Object reduce(Map<Integer, Object> map) {
    List<Map.Entry<Data, Data>> entries = new ArrayList<>();
    for (Object obj : map.values()) {
        if (obj == null) {
            continue;
        }
        EntrySetResponse response = (EntrySetResponse) obj;
        entries.addAll(response.getDataEntrySet());
    }
    updateStats(LocalMapStatsImpl::incrementOtherOperations);
    return entries;
}
Also used : LocalMapStatsImpl(com.hazelcast.internal.monitor.impl.LocalMapStatsImpl) ArrayList(java.util.ArrayList) EntrySetResponse(com.hazelcast.multimap.impl.operations.EntrySetResponse)

Example 3 with LocalMapStatsImpl

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

the class MultiMapKeySetMessageTask method reduce.

@Override
protected Object reduce(Map<Integer, Object> map) {
    List<Data> keys = new ArrayList<Data>();
    for (Object obj : map.values()) {
        if (obj == null) {
            continue;
        }
        MultiMapResponse response = (MultiMapResponse) obj;
        Collection<Data> coll = response.getCollection();
        if (coll != null) {
            keys.addAll(coll);
        }
    }
    updateStats(LocalMapStatsImpl::incrementOtherOperations);
    return keys;
}
Also used : LocalMapStatsImpl(com.hazelcast.internal.monitor.impl.LocalMapStatsImpl) MultiMapResponse(com.hazelcast.multimap.impl.operations.MultiMapResponse) ArrayList(java.util.ArrayList) Data(com.hazelcast.internal.serialization.Data)

Example 4 with LocalMapStatsImpl

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

the class NearCachedClientMapProxy method getLocalMapStats.

@Override
public LocalMapStats getLocalMapStats() {
    LocalMapStatsImpl localMapStats = (LocalMapStatsImpl) super.getLocalMapStats();
    localMapStats.setNearCacheStats(nearCache.getNearCacheStats());
    return localMapStats;
}
Also used : LocalMapStatsImpl(com.hazelcast.internal.monitor.impl.LocalMapStatsImpl)

Example 5 with LocalMapStatsImpl

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

the class PhoneHomeTest method testMapPutLatencyWithoutMapStore.

@Test
public void testMapPutLatencyWithoutMapStore() {
    Map<String, String> parameters;
    parameters = phoneHome.phoneHome(true);
    assertEquals(parameters.get(PhoneHomeMetrics.AVERAGE_PUT_LATENCY_OF_MAPS_WITHOUT_MAPSTORE.getRequestParameterName()), "-1");
    IMap<Object, Object> iMap = node.hazelcastInstance.getMap("hazelcast");
    LocalMapStatsImpl localMapStats = (LocalMapStatsImpl) iMap.getLocalMapStats();
    localMapStats.incrementPutLatencyNanos(2000000000L);
    parameters = phoneHome.phoneHome(true);
    assertEquals(parameters.get(PhoneHomeMetrics.AVERAGE_PUT_LATENCY_OF_MAPS_WITHOUT_MAPSTORE.getRequestParameterName()), String.valueOf(2000));
    localMapStats.incrementPutLatencyNanos(1000000000L);
    parameters = phoneHome.phoneHome(true);
    assertEquals(parameters.get(PhoneHomeMetrics.AVERAGE_PUT_LATENCY_OF_MAPS_WITHOUT_MAPSTORE.getRequestParameterName()), String.valueOf(1500));
    localMapStats.incrementPutLatencyNanos(2000000000L);
    parameters = phoneHome.phoneHome(true);
    assertEquals(parameters.get(PhoneHomeMetrics.AVERAGE_PUT_LATENCY_OF_MAPS_WITHOUT_MAPSTORE.getRequestParameterName()), String.valueOf(1666));
}
Also used : LocalMapStatsImpl(com.hazelcast.internal.monitor.impl.LocalMapStatsImpl) DistributedObject(com.hazelcast.core.DistributedObject) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

LocalMapStatsImpl (com.hazelcast.internal.monitor.impl.LocalMapStatsImpl)14 QuickTest (com.hazelcast.test.annotation.QuickTest)4 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 DistributedObject (com.hazelcast.core.DistributedObject)3 Data (com.hazelcast.internal.serialization.Data)2 MultiMapResponse (com.hazelcast.multimap.impl.operations.MultiMapResponse)2 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 InMemoryFormat (com.hazelcast.config.InMemoryFormat)1 MapConfig (com.hazelcast.config.MapConfig)1 MapStoreConfig (com.hazelcast.config.MapStoreConfig)1 LocalIndexStatsImpl (com.hazelcast.internal.monitor.impl.LocalIndexStatsImpl)1 PerIndexStats (com.hazelcast.internal.monitor.impl.PerIndexStats)1 IPartition (com.hazelcast.internal.partition.IPartition)1 IMap (com.hazelcast.map.IMap)1 LocalMapStats (com.hazelcast.map.LocalMapStats)1 RecordStore (com.hazelcast.map.impl.recordstore.RecordStore)1 MultiMapRecord (com.hazelcast.multimap.impl.MultiMapRecord)1