Example #1
0
        public Availability Availability()
        {
            var availability = monitors.Select(x => x.Availability()).Aggregate((x, y) => x | y);

            if (monitors.Count(x => x.Availability()) == 1)
            {
                availability.Add(AlertFactory.ServiceRedundancyLost(Info, "Redundancy has been lost."));
            }

            return(availability);
        }
Example #2
0
        private static Alert[] CollapseNoAvailabilityAlerts(IEnumerable <Alert> alerts)
        {
            var instances = alerts.SelectMany(x => x.Monitor.Instances).ToArray();

            return(new [] { AlertFactory.ServiceUnavailable(new MonitorInfo(alerts.First().Monitor, instances), alerts.First().Message) });
        }
Example #3
0
 private static Alert[] GetReducedAvailabilityAlerts(IEnumerable <Alert> alerts)
 {
     return(alerts.Select(x => AlertFactory.InstanceUnavailable(x.Monitor, x.Message)).ToArray());
 }