Exemplo n.º 1
0
 public void a_set_of_unavailable_instances_alerts_that_all_instances_are_down()
 {
     Given(() => unavailable_instance(unavailable_alert));
     And(() => unavailable_instance(unavailable_alert_2));
     When(getting_availability);
     Then(() => alerts(AlertFactory.ServiceUnavailable(new MonitorInfo(unavailable_alert.Monitor.Type,
                                                                       unavailable_alert.Monitor.Name,
                                                                       unavailable_alert.Monitor.Instances.Concat(unavailable_alert_2.Monitor.Instances).ToArray()),
                                                       unavailable_alert.Message)));
 }
Exemplo n.º 2
0
 public override Availability Availability()
 {
     try
     {
         CheckConnectivity();
         return(Monitoring.Availability.Up());
     }
     catch
     {
         return(Monitoring.Availability.Down(AlertFactory.ServiceUnavailable(Info, "Cosmos is unavailable or not configured.")));
     }
 }
Exemplo n.º 3
0
 public override Availability Availability()
 {
     try
     {
         Db.ExecuteAsync("SELECT 1", commandType: CommandType.Text).GetAwaiter().GetResult();
         return(Monitoring.Availability.Up());
     }
     catch (Exception ex)
     {
         return(Monitoring.Availability.Down(AlertFactory.ServiceUnavailable(Info, $"Database is down: {ex.Message}")));
     }
 }
Exemplo n.º 4
0
 public override Availability Availability()
 {
     try
     {
         return(url.WithHeaders(headers).GetAsync().Result.IsSuccessStatusCode ?
                Sensemaking.Monitoring.Availability.Up() :
                Sensemaking.Monitoring.Availability.Down(AlertFactory.ServiceUnavailable(Info, $"Service at {url} is down.")));
     }
     catch
     {
         return(Sensemaking.Monitoring.Availability.Down(AlertFactory.ServiceUnavailable(Info, $"Service at {url} is down.")));
     }
 }
Exemplo n.º 5
0
 private void a_service_unavailable_alert()
 {
     alert = AlertFactory.ServiceUnavailable(Fake.AnInstanceMonitor.Info, message);
 }
Exemplo n.º 6
0
 public InstanceMonitor(string alertMessage) : base(AMonitor.Info)
 {
     IsAvailable = false;
     Alert       = AlertFactory.ServiceUnavailable(AMonitor.Info, alertMessage);
 }
Exemplo n.º 7
0
        public void it_is_not_available()
        {
            var expected_availability = Availability.Down(AlertFactory.ServiceUnavailable(info, "Remote service is down."));

            the_availability.Status.should_be(expected_availability.Status);
        }