use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class TimedMemberState method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("master", master);
root.add("time", time);
root.add("clusterName", clusterName);
JsonArray instanceNames = new JsonArray();
for (String instanceName : this.instanceNames) {
instanceNames.add(instanceName);
}
root.add("instanceNames", instanceNames);
if (memberList != null) {
JsonArray members = new JsonArray();
for (String member : memberList) {
members.add(member);
}
root.add("memberList", members);
}
root.add("memberState", memberState.toJson());
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class LocalExecutorStatsImpl method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("creationTime", creationTime);
root.add("pending", pending);
root.add("started", started);
root.add("completed", completed);
root.add("cancelled", cancelled);
root.add("totalStartLatency", totalStartLatency);
root.add("totalExecutionTime", totalExecutionTime);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class LocalMemoryStatsImpl method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add(JSON_CREATION_TIME, creationTime);
root.add(JSON_TOTAL_PHYSICAL, totalPhysical);
root.add(JSON_FREE_PHYSICAL, freePhysical);
root.add(JSON_MAX_NATIVE_MEMORY, maxNativeMemory);
root.add(JSON_COMMITTED_NATIVE_MEMORY, committedNativeMemory);
root.add(JSON_USED_NATIVE_MEMORY, usedNativeMemory);
root.add(JSON_FREE_NATIVE_MEMORY, freeNativeMemory);
root.add(JSON_MAX_HEAP, maxHeap);
root.add(JSON_COMMITTED_HEAP, committedHeap);
root.add(JSON_USED_HEAP, usedHeap);
if (gcStats == null) {
gcStats = new LocalGCStatsImpl();
}
root.add(JSON_GC_STATS, gcStats.toJson());
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class LocalReplicatedMapStatsImpl 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("ownedEntryMemoryCost", ownedEntryMemoryCost);
root.add("creationTime", creationTime);
root.add("totalGetLatencies", totalGetLatencies);
root.add("totalPutLatencies", totalPutLatencies);
root.add("totalRemoveLatencies", totalRemoveLatencies);
root.add("maxGetLatency", maxGetLatency);
root.add("maxPutLatency", maxPutLatency);
root.add("maxRemoveLatency", maxRemoveLatency);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ClusterHotRestartStatusDTO method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("dataRecoveryPolicy", dataRecoveryPolicy.toString());
root.add("hotRestartStatus", hotRestartStatus.toString());
root.add("remainingValidationTimeMillis", remainingValidationTimeMillis);
root.add("remainingDataLoadTimeMillis", remainingDataLoadTimeMillis);
JsonArray memberStatuses = new JsonArray();
for (Map.Entry<String, MemberHotRestartStatus> entry : memberHotRestartStatusMap.entrySet()) {
String member = entry.getKey();
MemberHotRestartStatus status = entry.getValue();
JsonObject pair = new JsonObject();
pair.add("member", member);
pair.add("status", status.toString());
memberStatuses.add(pair);
}
root.add("memberHotRestartStatuses", memberStatuses);
return root;
}
Aggregations