private String formatMessage(long extraSleepTime,
    Map<String, GcTimes> gcTimesAfterSleep,
    Map<String, GcTimes> gcTimesBeforeSleep) {

    Set<String> gcBeanNames = Sets.intersection(
      gcTimesAfterSleep.keySet(),
      gcTimesBeforeSleep.keySet());
    List<String> gcDiffs = Lists.newArrayList();
    for (String name : gcBeanNames) {
      GcTimes diff = gcTimesAfterSleep.get(name).subtract(
        gcTimesBeforeSleep.get(name));
      if (diff.gcCount != 0) {
        gcDiffs.add("GC pool '" + name + "' had collection(s): " +
          diff.toString());
      }
    }

    String ret = "Detected pause in JVM or host machine (eg GC): " +
      "pause of approximately " + extraSleepTime + "ms\n";
    if (gcDiffs.isEmpty()) {
      ret += "No GCs detected";
    } else {
      ret += Joiner.on("\n").join(gcDiffs);
    }
    return ret;
  }
log INFO if we detect a pause longer than this threshold
common/src/java/org/apache/hadoop/hive/common/JvmPauseMonitor.java