private ThreatLevel getThreatLevel(double microseconds) {
    if (logCount > kMinLogsForAverage) {
      double average = getAverage();
      double sigma = getStandardDeviation();
      if (microseconds > accessTimes.get(accessTimes.size() - 1) + 0.5 * sigma)
        return ThreatLevel.RED;
      if (microseconds > average + 1.3 * sigma)
        return ThreatLevel.ORANGE;
      if (microseconds > average + 0.8 * sigma)
        return ThreatLevel.YELLOW;
      return ThreatLevel.BLUE;
    } else {
      if (microseconds > kRed)
        return ThreatLevel.RED;
      if (microseconds > kOrange)
        return ThreatLevel.ORANGE;
      if (microseconds > kYellow)
        return ThreatLevel.YELLOW;
    }
    return ThreatLevel.BLUE;
  }