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);
}
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;
}
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;
}
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;
}
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;
}
Aggregations