Пример #1
0
 private static void WriteStatus(LogAggregate agg)
 {
     Console.WriteLine($"Status Update - hits = {agg.RollingTotal} at {agg.Occurance}");
     foreach (var kvp in agg.Counts.OrderByDescending(k => k.Value).ThenBy(k => k.Key.Length))
     {
         if (kvp.Value > 0)
         {
             Console.WriteLine($"{kvp.Key} : {kvp.Value}");
         }
     }
     Console.WriteLine("--------------------------------------------------");
 }
Пример #2
0
 protected void OnAlertCancelled(LogAggregate agg) => AlertCancelled?.Invoke(this, agg);
Пример #3
0
 protected void OnAlertTriggered(LogAggregate agg) => AlertTriggered?.Invoke(this, agg);
Пример #4
0
 protected void OnAggregateProcessed(LogAggregate agg) => AggregateProcessed?.Invoke(this, agg);
Пример #5
0
 private static void WriteAlertCancelled(LogAggregate agg)
 {
     Console.WriteLine($"Traffic back to normal - hits = {agg.RollingTotal} at {agg.Occurance}");
 }
Пример #6
0
 private static void WriteAlertTriggered(LogAggregate agg)
 {
     Console.WriteLine($"High traffic generated an alert - hits = {agg.RollingTotal}, triggered at {agg.Occurance}");
 }