@Override
  public ObjectNode execute(final HttpServletRequest request) throws Exception {

    String userName = request.getUserPrincipal().getName();

    // get cluster object
    Cluster cluster = repository.getCluster();

    // json object to be sent as response
    ObjectNode responseJSON = mapper.createObjectNode();

    Cluster.Alert[] alertsList = cluster.getAlertsList();
    int severeAlertCount = 0;
    int errorAlertCount = 0;
    int warningAlertCount = 0;
    int infoAlertCount = 0;

    for (Cluster.Alert alertObj : alertsList) {
      if (alertObj.getSeverity() == Cluster.Alert.SEVERE) {
        severeAlertCount++;
      } else if (alertObj.getSeverity() == Cluster.Alert.ERROR) {
        errorAlertCount++;
      } else if (alertObj.getSeverity() == Cluster.Alert.WARNING) {
        warningAlertCount++;
      } else {
        infoAlertCount++;
      }
    }
    // getting basic details of Cluster
    responseJSON.put("clusterName", cluster.getServerName());
    responseJSON.put("severeAlertCount", severeAlertCount);
    responseJSON.put("errorAlertCount", errorAlertCount);
    responseJSON.put("warningAlertCount", warningAlertCount);
    responseJSON.put("infoAlertCount", infoAlertCount);

    responseJSON.put("totalMembers", cluster.getMemberCount());
    responseJSON.put("servers", cluster.getServerCount());
    responseJSON.put("clients", cluster.getClientConnectionCount());
    responseJSON.put("locators", cluster.getLocatorCount());
    responseJSON.put("totalRegions", cluster.getTotalRegionCount());
    long heapSize = cluster.getTotalHeapSize();

    Double heapS = heapSize / 1024D;
    responseJSON.put("totalHeap", TWO_PLACE_DECIMAL_FORMAT.format(heapS));
    responseJSON.put("functions", cluster.getRunningFunctionCount());
    responseJSON.put("uniqueCQs", cluster.getRegisteredCQCount());
    responseJSON.put("subscriptions", cluster.getSubscriptionCount());
    responseJSON.put("txnCommitted", cluster.getTxnCommittedCount());
    responseJSON.put("txnRollback", cluster.getTxnRollbackCount());
    responseJSON.put("userName", userName);

    return responseJSON;
  }
Class ClusterDetailsService

This service class has implementation for providing cluster's basic statistical data.

@since GemFire version 7.5
geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/service/ClusterDetailsService.java