// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace Microsoft.Extensions.Diagnostics.HealthChecks { /// /// A service which can be used to check the status of instances registered in the application. /// public interface IHealthCheckService { /// /// A containing all the health checks registered in the application. /// /// /// The key maps to the property of the health check, and the value is the /// instance itself. /// IReadOnlyDictionary Checks { get; } /// /// Runs all the health checks in the application and returns the aggregated status. /// /// A which can be used to cancel the health checks. /// /// A which will complete when all the health checks have been run, /// yielding a containing the results. /// Task CheckHealthAsync(CancellationToken cancellationToken = default); /// /// Runs the provided health checks and returns the aggregated status /// /// The instances to be run. /// A which can be used to cancel the health checks. /// /// A which will complete when all the health checks have been run, /// yielding a containing the results. /// Task CheckHealthAsync(IEnumerable checks, CancellationToken cancellationToken = default); } }