use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class LocalOperationStatsImpl method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("maxVisibleSlowOperationCount", maxVisibleSlowOperationCount);
JsonArray slowOperationArray = new JsonArray();
int logCount = 0;
for (SlowOperationDTO slowOperation : slowOperations) {
if (logCount++ < maxVisibleSlowOperationCount) {
slowOperationArray.add(slowOperation.toJson());
}
}
root.add("slowOperations", slowOperationArray);
root.add("creationTime", creationTime);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class LocalQueueStatsImpl method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("ownedItemCount", ownedItemCount);
root.add("backupItemCount", backupItemCount);
root.add("minAge", minAge);
root.add("maxAge", maxAge);
root.add("aveAge", aveAge);
root.add("creationTime", creationTime);
root.add("numberOfOffers", numberOfOffers);
root.add("numberOfPolls", numberOfPolls);
root.add("numberOfRejectedOffers", numberOfRejectedOffers);
root.add("numberOfEmptyPolls", numberOfEmptyPolls);
root.add("numberOfOtherOperations", numberOfOtherOperations);
root.add("numberOfEvents", numberOfEvents);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class LocalTopicStatsImpl method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("creationTime", creationTime);
root.add("totalPublishes", totalPublishes);
root.add("totalReceivedMessages", totalReceivedMessages);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class MancenterServlet method doPost.
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
BufferedReader br = req.getReader();
StringBuilder sb = new StringBuilder();
String str;
while ((str = br.readLine()) != null) {
sb.append(str);
}
final String json = sb.toString();
final JsonObject object = JsonObject.readFrom(json);
process(object);
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class MapConfigRequestTest method testGetMapConfig.
@Test
public void testGetMapConfig() {
MapConfigRequest request = new MapConfigRequest(mapName, dto, false);
JsonObject jsonObject = new JsonObject();
request.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
MapConfig mapConfig = (MapConfig) request.readResponse(result);
assertNotNull(mapConfig);
assertEquals("default", mapConfig.getName());
}
Aggregations