Search in sources :

Example 36 with JsonObject

use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.

the class TimedMemberState method fromJson.

@Override
public void fromJson(JsonObject json) {
    time = getLong(json, "time");
    master = getBoolean(json, "master");
    clusterName = getString(json, "clusterName");
    instanceNames = new HashSet<String>();
    final JsonArray jsonInstanceNames = getArray(json, "instanceNames");
    for (JsonValue instanceName : jsonInstanceNames.values()) {
        instanceNames.add(instanceName.asString());
    }
    memberList = new ArrayList<String>();
    final JsonArray jsonMemberList = getArray(json, "memberList");
    for (JsonValue member : jsonMemberList.values()) {
        memberList.add(member.asString());
    }
    final JsonObject jsonMemberState = getObject(json, "memberState");
    memberState = new MemberStateImpl();
    memberState.fromJson(jsonMemberState);
}
Also used : JsonArray(com.eclipsesource.json.JsonArray) MemberStateImpl(com.hazelcast.monitor.impl.MemberStateImpl) JsonValue(com.eclipsesource.json.JsonValue) JsonObject(com.eclipsesource.json.JsonObject) JsonUtil.getString(com.hazelcast.util.JsonUtil.getString)

Example 37 with JsonObject

use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.

the class HotRestartStateImpl method toJson.

@Override
public JsonObject toJson() {
    final JsonObject root = new JsonObject();
    if (backupTaskStatus != null) {
        root.add("backupTaskState", backupTaskStatus.getState().name());
        root.add("backupTaskCompleted", backupTaskStatus.getCompleted());
        root.add("backupTaskTotal", backupTaskStatus.getTotal());
        root.add("isHotBackupEnabled", isHotBackupEnabled);
    }
    return root;
}
Also used : JsonObject(com.eclipsesource.json.JsonObject)

Example 38 with JsonObject

use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.

the class LocalCacheStatsImpl method toJson.

@Override
public JsonObject toJson() {
    JsonObject root = new JsonObject();
    root.add("creationTime", creationTime);
    root.add("lastAccessTime", lastAccessTime);
    root.add("lastUpdateTime", lastUpdateTime);
    root.add("ownedEntryCount", ownedEntryCount);
    root.add("cacheHits", cacheHits);
    root.add("cacheHitPercentage", cacheHitPercentage);
    root.add("cacheMisses", cacheMisses);
    root.add("cacheMissPercentage", cacheMissPercentage);
    root.add("cacheGets", cacheGets);
    root.add("cachePuts", cachePuts);
    root.add("cacheRemovals", cacheRemovals);
    root.add("cacheEvictions", cacheEvictions);
    root.add("averageGetTime", averageGetTime);
    root.add("averagePutTime", averagePutTime);
    root.add("averageRemoveTime", averageRemoveTime);
    return root;
}
Also used : JsonObject(com.eclipsesource.json.JsonObject)

Example 39 with JsonObject

use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.

the class LocalGCStatsImpl method toJson.

@Override
public JsonObject toJson() {
    JsonObject root = new JsonObject();
    root.add("creationTime", creationTime);
    root.add("minorCount", minorCount);
    root.add("minorTime", minorTime);
    root.add("majorCount", majorCount);
    root.add("majorTime", majorTime);
    root.add("unknownCount", unknownCount);
    root.add("unknownTime", unknownTime);
    return root;
}
Also used : JsonObject(com.eclipsesource.json.JsonObject)

Example 40 with JsonObject

use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.

the class LocalMapStatsImpl method toJson.

@Override
public JsonObject toJson() {
    JsonObject root = new JsonObject();
    root.add("getCount", getCount);
    root.add("putCount", putCount);
    root.add("removeCount", removeCount);
    root.add("numberOfOtherOperations", numberOfOtherOperations);
    root.add("numberOfEvents", numberOfEvents);
    root.add("lastAccessTime", lastAccessTime);
    root.add("lastUpdateTime", lastUpdateTime);
    root.add("hits", hits);
    root.add("ownedEntryCount", ownedEntryCount);
    root.add("backupEntryCount", backupEntryCount);
    root.add("backupCount", backupCount);
    root.add("ownedEntryMemoryCost", ownedEntryMemoryCost);
    root.add("backupEntryMemoryCost", backupEntryMemoryCost);
    root.add("creationTime", creationTime);
    root.add("lockedEntryCount", lockedEntryCount);
    root.add("dirtyEntryCount", dirtyEntryCount);
    root.add("totalGetLatencies", totalGetLatencies);
    root.add("totalPutLatencies", totalPutLatencies);
    root.add("totalRemoveLatencies", totalRemoveLatencies);
    root.add("maxGetLatency", maxGetLatency);
    root.add("maxPutLatency", maxPutLatency);
    root.add("maxRemoveLatency", maxRemoveLatency);
    root.add("heapCost", heapCost);
    if (nearCacheStats != null) {
        root.add("nearCacheStats", nearCacheStats.toJson());
    }
    return root;
}
Also used : JsonObject(com.eclipsesource.json.JsonObject)

Aggregations

JsonObject (com.eclipsesource.json.JsonObject)499 Test (org.junit.Test)157 URL (java.net.URL)145 JsonArray (com.eclipsesource.json.JsonArray)96 JsonValue (com.eclipsesource.json.JsonValue)43 ParallelTest (com.hazelcast.test.annotation.ParallelTest)36 QuickTest (com.hazelcast.test.annotation.QuickTest)36 ArrayList (java.util.ArrayList)33 HashMap (java.util.HashMap)28 IOException (java.io.IOException)17 Map (java.util.Map)17 Matchers.containsString (org.hamcrest.Matchers.containsString)17 Date (java.util.Date)13 JsonUtil.getString (com.hazelcast.util.JsonUtil.getString)12 MalformedURLException (java.net.MalformedURLException)11 WalletCallException (com.vaklinov.zcashui.ZCashClientCaller.WalletCallException)7 URISyntaxException (java.net.URISyntaxException)6 ExecuteScriptRequest (com.hazelcast.internal.management.request.ExecuteScriptRequest)5 Link (org.eclipse.leshan.Link)5 Jedis (redis.clients.jedis.Jedis)5