Esempio n. 1
0
        private void RegisterDiagnostics(IVostokApplicationDiagnostics diagnostics)
        {
            var info         = GetInfo();
            var infoEntry    = new DiagnosticEntry("scheduled", info.Name);
            var infoProvider = new ScheduledActionsInfoProvider(GetInfo);
            var healthCheck  = new ScheduledActionsHealthCheck(GetInfo);

            diagnosticInfoRegistration = diagnostics.Info.RegisterProvider(infoEntry, infoProvider);
            healthCheckRegistration    = diagnostics.HealthTracker.RegisterCheck($"scheduled ({info.Name})", healthCheck);
        }
        private void RegisterDiagnosticFeatures(IVostokHostingEnvironment environment)
        {
            if (!environment.HostExtensions.TryGet <IVostokApplicationDiagnostics>(out var diagnostics))
            {
                return;
            }

            foreach (var actionRunner in runner.Runners)
            {
                var info         = actionRunner.GetInfo();
                var infoEntry    = new DiagnosticEntry("scheduled", info.Name);
                var infoProvider = new ScheduledActionsInfoProvider(actionRunner);
                var healthCheck  = new ScheduledActionsHealthCheck(actionRunner);

                disposables.Add(diagnostics.Info.RegisterProvider(infoEntry, infoProvider));
                disposables.Add(diagnostics.HealthTracker.RegisterCheck($"scheduled ({info.Name})", healthCheck));
            }
        }