/**
  * Creates a stats object representing a performance failure
  *
  * @param contextName The failure context information.
  * @param elapsed The elapsed time in milliseconds
  * @return The failure stats
  */
 private PerformanceStats createFailureStats(String contextName, long elapsed) {
   PerformanceStats failedStat = new PerformanceStats(event, blame, contextName);
   PerformanceStats old = statMap.get(failedStat);
   if (old == null) statMap.put(failedStat, failedStat);
   else failedStat = old;
   failedStat.isFailure = true;
   failedStat.runCount++;
   failedStat.runningTime += elapsed;
   return failedStat;
 }
  private void stopMeter(final PerformanceStats stats, String operation) {
    if (MEASURE_PERFORMANCE) {
      stats.endRun();
      if (stats.isFailure()) {
        IStatus status = createPerformanceStatus(operation);
        fRegistry.informUser(this, status);
        return;
      }
    }

    if (fIsReportingDelay) {
      long current = System.currentTimeMillis();
      if (current - fStart > MAX_DELAY) {
        IStatus status = createPerformanceStatus(operation);
        fRegistry.informUser(this, status);
      }
    }
  }