private void renderSlowHistory(DiagnosticsLogWriter writer) {
   writer.startSection("SlowHistory");
   for (String item : slowOccurrences.descendingKeys()) {
     writer.writeEntry(item + " samples=" + slowOccurrences.get(item));
   }
   writer.endSection();
 }
  private void runCurrent(DiagnosticsLogWriter writer, long now) {
    writer.startSection("Pending");
    for (Invocation invocation : invocationRegistry) {
      long durationMs = now - invocation.firstInvocationTimeMillis;
      if (durationMs >= thresholdMillis) {
        writer.writeEntry(invocation.toString() + " duration=" + durationMs + " ms");
        slowOccurrences.add(invocation.op.getClass().getName(), 1);
      }

      occurrences.add(invocation.op.getClass().getName(), 1);
    }
    writer.endSection();
  }