HealthCheckService 类

定义

一种服务,可用于检查在应用程序中注册的 IHealthCheck 实例的状态。A service which can be used to check the status of IHealthCheck instances registered in the application.

public ref class HealthCheckService abstract
public abstract class HealthCheckService
type HealthCheckService = class
Public MustInherit Class HealthCheckService
继承
HealthCheckService

注解

HealthCheckService 依赖关系注入容器中,通过调用将的默认实现注册为单独服务 AddHealthChecks(IServiceCollection)The default implementation of HealthCheckService is registered in the dependency injection container as a singleton service by calling AddHealthChecks(IServiceCollection).

IHealthChecksBuilder返回的AddHealthChecks(IServiceCollection)The IHealthChecksBuilder returned by AddHealthChecks(IServiceCollection) 提供便利的 API 用于注册运行状况检查。provides a convenience API for registering health checks.

IHealthCheck 实现可以通过提供的扩展方法进行注册 IHealthChecksBuilder IHealthCheck implementations can be registered through extension methods provided by IHealthChecksBuilder.

构造函数

HealthCheckService()

方法

CheckHealthAsync(CancellationToken)

运行应用程序中的所有运行状况检查并返回聚合状态。Runs all the health checks in the application and returns the aggregated status.

CheckHealthAsync(Func<HealthCheckRegistration,Boolean>, CancellationToken)

运行提供的运行状况检查并返回聚合状态。Runs the provided health checks and returns the aggregated status.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于