internal static bool IsUnderHighLoad(ApplicationPerformanceCounters counters)
 {
     return
         (ThresholdExceeded(counters.Connections, counters.ConnectionLimit, ConnectionThreshold) ||
          ThresholdExceeded(counters.Threads, counters.ThreadLimit, ThreadThreshold) ||
          ThresholdExceeded(counters.Processes, counters.ProcessLimit, ProcessesThreshold) ||
          ThresholdExceeded(counters.NamedPipes, counters.NamedPipeLimit, NamedPipesThreshold));
 }
        internal static bool IsUnderHighLoad(ApplicationPerformanceCounters counters, Collection <string> exceededCounters = null)
        {
            bool exceeded = false;

            // determine all counters whose limits have been exceeded
            exceeded |= ThresholdExceeded("Connections", counters.Connections, counters.ConnectionLimit, ConnectionThreshold, exceededCounters);
            exceeded |= ThresholdExceeded("Threads", counters.Threads, counters.ThreadLimit, ThreadThreshold, exceededCounters);
            exceeded |= ThresholdExceeded("Processes", counters.Processes, counters.ProcessLimit, ProcessesThreshold, exceededCounters);
            exceeded |= ThresholdExceeded("NamedPipes", counters.NamedPipes, counters.NamedPipeLimit, NamedPipesThreshold, exceededCounters);

            return(exceeded);
        }