Exemple #1
0
        public void GetOriginAlertsWithTimeRangeTest()
        {
            var account        = App.Config.GetDefaultAccount();
            var context        = account.GetContext();
            var origins        = context.StreamingEndpoints.ToList();
            var runningOrigins = origins.Where(s => s.State == StreamingEndpointState.Running);
            var controller     = new OriginAlertsController();

            foreach (var origin in runningOrigins)
            {
                var alerts = controller.Get(account.AccountName, origin.Id.NimbusIdToRawGuid(), null).ToList();
                Trace.TraceInformation("Channe:{0}, Alerts:{1}", origin.Id, alerts.Count);
            }
        }
Exemple #2
0
        public void GetOriginAlertsTest()
        {
            var account        = App.Config.GetDefaultAccount();
            var context        = account.GetContext();
            var origins        = context.StreamingEndpoints.ToList();
            var runningOrigins = origins.Where(s => s.State == StreamingEndpointState.Running);
            var controller     = new OriginAlertsController();

            var query = new AlertsQuery
            {
                EndTime      = DateTime.UtcNow,
                StartTime    = DateTime.UtcNow - TimeSpan.FromHours(1),
                StatusLevels = new[] { HealthStatus.Warning, HealthStatus.Critical }
            };

            foreach (var origin in runningOrigins)
            {
                var alerts = controller.Get(account.AccountName, origin.Id.NimbusIdToRawGuid(), query).ToList();
                Trace.TraceInformation("Channe:{0}, Alerts:{1}", origin.Id, alerts.Count);
            }
        }