private ResultModel getDistributedRegionMetrics(String regionName, String export_to_report_to,
      String[] categoriesArr, StringBuilder csvBuilder) {

    final ManagementService managementService = getManagementService();

    DistributedRegionMXBean regionMxBean = managementService.getDistributedRegionMXBean(regionName);

    if (regionMxBean == null) {
      String errorMessage = CliStrings.format(CliStrings.SHOW_METRICS__ERROR,
          "Distributed Region MBean for " + regionName + " not found");
      return ResultModel.createError(errorMessage);
    }

    ResultModel result = new ResultModel();
    TabularResultModel metricsTable = result.addTable("metrics");
    metricsTable.setHeader("Cluster-wide Region Metrics");

    Set<Category> categoriesToDisplay = ArrayUtils.isNotEmpty(categoriesArr)
        ? getCategorySet(categoriesArr) : new HashSet<>(SYSTEM_REGION_METRIC_CATEGORIES);

    writeSystemRegionMetricValues(regionMxBean, metricsTable, csvBuilder, categoriesToDisplay);

    if (StringUtils.isNotEmpty(export_to_report_to)) {
      result.addFile(export_to_report_to, csvBuilder != null ? csvBuilder.toString() : null);
    }

    return result;
  }
Gets the Cluster-wide metrics for a region

@return ResultData containing the table
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/ShowMetricsCommand.java