use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class MemberStateImpl method toJson.
@Override
public JsonObject toJson() {
final JsonObject root = new JsonObject();
root.add("address", address);
serializeMap(root, "mapStats", mapStats);
serializeMap(root, "multiMapStats", multiMapStats);
serializeMap(root, "replicatedMapStats", replicatedMapStats);
serializeMap(root, "queueStats", queueStats);
serializeMap(root, "topicStats", topicStats);
serializeMap(root, "executorStats", executorStats);
serializeMap(root, "cacheStats", cacheStats);
serializeMap(root, "wanStats", wanStats);
final JsonObject runtimePropsObject = new JsonObject();
for (Map.Entry<String, Long> entry : runtimeProps.entrySet()) {
runtimePropsObject.add(entry.getKey(), entry.getValue());
}
root.add("runtimeProps", runtimePropsObject);
final JsonArray clientsArray = new JsonArray();
for (ClientEndPointDTO client : clients) {
clientsArray.add(client.toJson());
}
root.add("clients", clientsArray);
root.add("beans", beans.toJson());
root.add("memoryStats", memoryStats.toJson());
root.add("operationStats", operationStats.toJson());
root.add("memberPartitionState", memberPartitionState.toJson());
root.add("nodeState", nodeState.toJson());
root.add("hotRestartState", hotRestartState.toJson());
root.add("clusterHotRestartStatus", clusterHotRestartStatus.toJson());
root.add("wanSyncState", wanSyncState.toJson());
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class MemberStateImpl method serializeMap.
private static void serializeMap(JsonObject root, String key, Map<String, ? extends JsonSerializable> map) {
final JsonObject jsonObject = new JsonObject();
for (Entry<String, ? extends JsonSerializable> e : map.entrySet()) {
jsonObject.add(e.getKey(), e.getValue().toJson());
}
root.add(key, jsonObject);
}
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;
}
Aggregations