public HealthCheckEndpointMiddleware(
     RequestDelegate next,
     AspNetMetricsOptions aspNetOptions,
     ILoggerFactory loggerFactory,
     IMetrics metrics,
     IHealthResponseWriter healthResponseWriter)
     : base(next, aspNetOptions, loggerFactory, metrics)
 {
     _healthResponseWriter = healthResponseWriter ?? throw new ArgumentNullException(nameof(healthResponseWriter));
 }
 public HealthCheckEndpointMiddleware(
     RequestDelegate next,
     AppMetricsMiddlewareHealthChecksOptions appMiddlewareOptions,
     ILoggerFactory loggerFactory,
     IProvideHealth health,
     IHealthResponseWriter healthResponseWriter)
 {
     _next = next;
     _appMiddlewareOptions = appMiddlewareOptions;
     _health = health;
     _logger = loggerFactory.CreateLogger <HealthCheckEndpointMiddleware>();
     _healthResponseWriter = healthResponseWriter ?? throw new ArgumentNullException(nameof(healthResponseWriter));
 }
Beispiel #3
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;
 }