Ejemplo n.º 1
0
 private static void AddMonitorOutputToStringBuilder(TimedEventHistory eventHistory5m, TimedEventHistory eventHistory1h, TimedEventHistory eventHistory24h, string name, StringBuilder sb)
 {
     sb.Append($"{eventHistory5m.TotalEvents.ToString().PadLeft(7)} {eventHistory5m.AverageEventDuration:N4} {eventHistory5m.LongestEvent:N3} {eventHistory5m.LastEvent:N3} {((int)eventHistory5m.TotalSeconds).ToString().PadLeft(3)} - " +
               $"{eventHistory1h.TotalEvents.ToString().PadLeft(7)} {eventHistory1h.AverageEventDuration:N4} {eventHistory1h.LongestEvent:N3} {eventHistory1h.LastEvent:N3} {((int)eventHistory1h.TotalSeconds).ToString().PadLeft(4)} - " +
               $"{eventHistory24h.TotalEvents.ToString().PadLeft(7)} {eventHistory24h.AverageEventDuration:N4} {eventHistory24h.LongestEvent:N3} {eventHistory24h.LastEvent:N3} {((int)eventHistory24h.TotalSeconds).ToString().PadLeft(5)} - " +
               $"{name}{'\n'}");
 }
Ejemplo n.º 2
0
        static ServerPerformanceMonitor()
        {
            for (int i = 0; i < monitors5m.Length; i++)
            {
                monitors5m[i]  = new RateMonitor();
                monitors1h[i]  = new RateMonitor();
                monitors24h[i] = new RateMonitor();
            }

            for (int i = 0; i < cumulative5m.Length; i++)
            {
                cumulative5m[i]  = new TimedEventHistory();
                cumulative1h[i]  = new TimedEventHistory();
                cumulative24h[i] = new TimedEventHistory();
            }
        }