public static void main(String[] args) throws IOException {
    String archiveName = null;
    final StatArchiveReader reader;
    if (args.length > 1) {
      if (!args[0].equals("stat") || args.length > 3) {
        System.err.println("Usage: stat archiveName statType.statName");
        ExitCode.FATAL.doSystemExit();
      }
      archiveName = args[1];
      String statSpec = args[2];
      if (!statSpec.contains(".")) {
        throw new IllegalArgumentException(
            "stat spec '" + statSpec + "' is malformed - use StatType.statName");
      }
      File archiveFile = new File(archiveName);
      if (!archiveFile.exists()) {
        throw new IllegalArgumentException("archive file does not exist: " + archiveName);
      }
      if (!archiveFile.canRead()) {
        throw new IllegalArgumentException("archive file exists but is unreadable: " + archiveName);
      }
      File[] archives = new File[] {archiveFile};
      SingleStatRawStatSpec[] filters =
          new SingleStatRawStatSpec[] {new SingleStatRawStatSpec(archiveName, args[2])};
      reader = new StatArchiveReader(archives, filters, false);
      final StatValue[] statValues = reader.matchSpec(filters[0]);
      System.out.println(statSpec + " matched " + statValues.length + " stats...");
      for (StatValue value : statValues) {
        printStatValue(value, -1, -1, true, false, false, false, true);
      }
      System.out.println();
      System.out.flush();
    } else {
      if (args.length == 1) {
        archiveName = args[0];
      } else {
        archiveName = "statArchive.gfs";
      }
      reader = new StatArchiveReader(archiveName);
      System.out.println("DEBUG: memory used = " + reader.getMemoryUsed());
    }
    reader.close();
  }
Simple utility to read and dump statistic archive.
geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveReader.java