Search in sources :

Example 1 with LocalReplicatedMapStats

use of com.hazelcast.monitor.LocalReplicatedMapStats in project hazelcast by hazelcast.

the class ReplicatedMapStatsTest method testGetOperationCount.

@Test
public void testGetOperationCount() throws Exception {
    ReplicatedMap<Integer, Integer> replicatedMap = getReplicatedMap();
    replicatedMap.put(1, 1);
    int count = 100;
    for (int i = 0; i < count; i++) {
        replicatedMap.get(1);
    }
    LocalReplicatedMapStats stats = replicatedMap.getReplicatedMapStats();
    assertEquals(count, stats.getGetOperationCount());
}
Also used : LocalReplicatedMapStats(com.hazelcast.monitor.LocalReplicatedMapStats) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 2 with LocalReplicatedMapStats

use of com.hazelcast.monitor.LocalReplicatedMapStats in project hazelcast by hazelcast.

the class ReplicatedMapStatsTest method testGetAndHitsGenerated.

@Test
public void testGetAndHitsGenerated() throws Exception {
    ReplicatedMap<Integer, Integer> replicatedMap = getReplicatedMap();
    for (int i = 0; i < 100; i++) {
        replicatedMap.put(i, i);
        replicatedMap.get(i);
    }
    LocalReplicatedMapStats stats = replicatedMap.getReplicatedMapStats();
    assertEquals(100, stats.getHits());
}
Also used : LocalReplicatedMapStats(com.hazelcast.monitor.LocalReplicatedMapStats) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 3 with LocalReplicatedMapStats

use of com.hazelcast.monitor.LocalReplicatedMapStats in project hazelcast by hazelcast.

the class MemberStateImpl method fromJson.

//CHECKSTYLE:OFF
@Override
public void fromJson(JsonObject json) {
    address = getString(json, "address");
    for (JsonObject.Member next : getObject(json, "mapStats")) {
        LocalMapStatsImpl stats = new LocalMapStatsImpl();
        stats.fromJson(next.getValue().asObject());
        mapStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "multiMapStats")) {
        LocalMultiMapStatsImpl stats = new LocalMultiMapStatsImpl();
        stats.fromJson(next.getValue().asObject());
        multiMapStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "replicatedMapStats", new JsonObject())) {
        LocalReplicatedMapStats stats = new LocalReplicatedMapStatsImpl();
        stats.fromJson(next.getValue().asObject());
        replicatedMapStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "queueStats")) {
        LocalQueueStatsImpl stats = new LocalQueueStatsImpl();
        stats.fromJson(next.getValue().asObject());
        queueStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "topicStats")) {
        LocalTopicStatsImpl stats = new LocalTopicStatsImpl();
        stats.fromJson(next.getValue().asObject());
        topicStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "executorStats")) {
        LocalExecutorStatsImpl stats = new LocalExecutorStatsImpl();
        stats.fromJson(next.getValue().asObject());
        executorStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "cacheStats", new JsonObject())) {
        LocalCacheStats stats = new LocalCacheStatsImpl();
        stats.fromJson(next.getValue().asObject());
        cacheStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "wanStats", new JsonObject())) {
        LocalWanStats stats = new LocalWanStatsImpl();
        stats.fromJson(next.getValue().asObject());
        wanStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "runtimeProps")) {
        runtimeProps.put(next.getName(), next.getValue().asLong());
    }
    final JsonArray jsonClients = getArray(json, "clients");
    for (JsonValue jsonClient : jsonClients) {
        final ClientEndPointDTO client = new ClientEndPointDTO();
        client.fromJson(jsonClient.asObject());
        clients.add(client);
    }
    beans = new MXBeansDTO();
    beans.fromJson(getObject(json, "beans"));
    JsonObject jsonMemoryStats = getObject(json, "memoryStats", null);
    if (jsonMemoryStats != null) {
        memoryStats.fromJson(jsonMemoryStats);
    }
    JsonObject jsonOperationStats = getObject(json, "operationStats", null);
    if (jsonOperationStats != null) {
        operationStats.fromJson(jsonOperationStats);
    }
    JsonObject jsonMemberPartitionState = getObject(json, "memberPartitionState", null);
    if (jsonMemberPartitionState != null) {
        memberPartitionState = new MemberPartitionStateImpl();
        memberPartitionState.fromJson(jsonMemberPartitionState);
    }
    JsonObject jsonNodeState = getObject(json, "nodeState", null);
    if (jsonNodeState != null) {
        nodeState = new NodeStateImpl();
        nodeState.fromJson(jsonNodeState);
    }
    JsonObject jsonHotRestartState = getObject(json, "hotRestartState", null);
    if (jsonHotRestartState != null) {
        hotRestartState = new HotRestartStateImpl();
        hotRestartState.fromJson(jsonHotRestartState);
    }
    JsonObject jsonClusterHotRestartStatus = getObject(json, "clusterHotRestartStatus", null);
    if (jsonClusterHotRestartStatus != null) {
        clusterHotRestartStatus = new ClusterHotRestartStatusDTO();
        clusterHotRestartStatus.fromJson(jsonClusterHotRestartStatus);
    }
    JsonObject jsonWanSyncState = getObject(json, "wanSyncState", null);
    if (jsonWanSyncState != null) {
        wanSyncState = new WanSyncStateImpl();
        wanSyncState.fromJson(jsonWanSyncState);
    }
}
Also used : LocalCacheStats(com.hazelcast.monitor.LocalCacheStats) ClientEndPointDTO(com.hazelcast.internal.management.dto.ClientEndPointDTO) JsonValue(com.eclipsesource.json.JsonValue) JsonObject(com.eclipsesource.json.JsonObject) MXBeansDTO(com.hazelcast.internal.management.dto.MXBeansDTO) JsonArray(com.eclipsesource.json.JsonArray) LocalWanStats(com.hazelcast.monitor.LocalWanStats) ClusterHotRestartStatusDTO(com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO) LocalReplicatedMapStats(com.hazelcast.monitor.LocalReplicatedMapStats)

Example 4 with LocalReplicatedMapStats

use of com.hazelcast.monitor.LocalReplicatedMapStats in project hazelcast by hazelcast.

the class ReplicatedMapStatsTest method testPutOperationCount.

@Test
public void testPutOperationCount() throws Exception {
    ReplicatedMap<Integer, Integer> replicatedMap = getReplicatedMap();
    int count = 100;
    for (int i = 0; i < count; i++) {
        replicatedMap.put(i, i);
    }
    LocalReplicatedMapStats stats = replicatedMap.getReplicatedMapStats();
    assertEquals(count, stats.getPutOperationCount());
}
Also used : LocalReplicatedMapStats(com.hazelcast.monitor.LocalReplicatedMapStats) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 5 with LocalReplicatedMapStats

use of com.hazelcast.monitor.LocalReplicatedMapStats in project hazelcast by hazelcast.

the class ReplicatedMapStatsTest method testPutAndHitsGenerated.

@Test
public void testPutAndHitsGenerated() throws Exception {
    ReplicatedMap<Integer, Integer> replicatedMap = getReplicatedMap();
    for (int i = 0; i < 100; i++) {
        replicatedMap.put(i, i);
        replicatedMap.get(i);
    }
    LocalReplicatedMapStats stats = replicatedMap.getReplicatedMapStats();
    assertEquals(100, stats.getHits());
}
Also used : LocalReplicatedMapStats(com.hazelcast.monitor.LocalReplicatedMapStats) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

LocalReplicatedMapStats (com.hazelcast.monitor.LocalReplicatedMapStats)7 ParallelTest (com.hazelcast.test.annotation.ParallelTest)6 QuickTest (com.hazelcast.test.annotation.QuickTest)6 Test (org.junit.Test)6 JsonArray (com.eclipsesource.json.JsonArray)1 JsonObject (com.eclipsesource.json.JsonObject)1 JsonValue (com.eclipsesource.json.JsonValue)1 ClientEndPointDTO (com.hazelcast.internal.management.dto.ClientEndPointDTO)1 ClusterHotRestartStatusDTO (com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO)1 MXBeansDTO (com.hazelcast.internal.management.dto.MXBeansDTO)1 LocalCacheStats (com.hazelcast.monitor.LocalCacheStats)1 LocalWanStats (com.hazelcast.monitor.LocalWanStats)1