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); }
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) }); }
private static Alert[] GetReducedAvailabilityAlerts(IEnumerable <Alert> alerts) { return(alerts.Select(x => AlertFactory.InstanceUnavailable(x.Monitor, x.Message)).ToArray()); }