예제 #1
0
파일: HealthRoot.cs 프로젝트: lulzzz/Health
 public HealthRoot(
     IHealth health,
     HealthOptions options,
     HealthFormatterCollection metricsOutputFormatters,
     IHealthOutputFormatter defaultMetricsOutputFormatter,
     IRunHealthChecks healthCheckRunner)
 {
     Options = options ?? throw new ArgumentNullException(nameof(options));
     _health = health ?? throw new ArgumentNullException(nameof(health));
     OutputHealthFormatters       = metricsOutputFormatters ?? new HealthFormatterCollection();
     DefaultOutputHealthFormatter = defaultMetricsOutputFormatter;
     HealthCheckRunner            = healthCheckRunner;
 }
예제 #2
0
 // ReSharper disable UnusedParameter.Local
 public HealthCheckEndpointMiddleware(
     RequestDelegate next,
     ILoggerFactory loggerFactory,
     IRunHealthChecks healthCheckRunner,
     IHealthResponseWriter healthResponseWriter,
     TimeSpan timeout)
 // ReSharper restore UnusedParameter.Local
 {
     _healthCheckRunner    = healthCheckRunner;
     _logger               = loggerFactory.CreateLogger <HealthCheckEndpointMiddleware>();
     _healthResponseWriter = healthResponseWriter ?? throw new ArgumentNullException(nameof(healthResponseWriter));
     _timeout              = timeout <= TimeSpan.Zero ? TimeSpan.FromSeconds(20) : timeout;
 }