public static long getAverageLatency(long Xn, long XNTime) {
    if (Xn != 0 && XNTime != 0) {
      return XNTime / Xn;
    }
    return 0;
  }
This is a utility class to calculate various type of Metrics out of raw stats
geode-core/src/main/java/org/apache/geode/management/internal/beans/MetricsCalculator.java