HealthCheckService.CheckHealthAsync 方法

定义

重载

CheckHealthAsync(CancellationToken)

运行应用程序中的所有运行状况检查并返回聚合状态。

CheckHealthAsync(Func<HealthCheckRegistration,Boolean>, CancellationToken)

运行提供的运行状况检查并返回聚合状态

CheckHealthAsync(CancellationToken)

Source:
HealthCheckService.cs
Source:
HealthCheckService.cs
Source:
HealthCheckService.cs
Source:
HealthCheckService.cs
Source:
HealthCheckService.cs

运行应用程序中的所有运行状况检查并返回聚合状态。

public System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthReport> CheckHealthAsync (System.Threading.CancellationToken cancellationToken = default);
member this.CheckHealthAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthReport>
Public Function CheckHealthAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of HealthReport)

参数

cancellationToken
CancellationToken

可用于取消运行状况检查的 CancellationToken

返回

一个 Task<TResult>,将在运行所有运行状况检查后完成,并生成包含结果的 HealthReport

例外

取消令牌已取消。 此异常存储在返回的任务中。

适用于

CheckHealthAsync(Func<HealthCheckRegistration,Boolean>, CancellationToken)

Source:
HealthCheckService.cs
Source:
HealthCheckService.cs
Source:
HealthCheckService.cs
Source:
HealthCheckService.cs
Source:
HealthCheckService.cs

运行提供的运行状况检查并返回聚合状态

public abstract System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthReport> CheckHealthAsync (Func<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckRegistration,bool>? predicate, System.Threading.CancellationToken cancellationToken = default);
abstract member CheckHealthAsync : Func<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckRegistration, bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthReport>
Public MustOverride Function CheckHealthAsync (predicate As Func(Of HealthCheckRegistration, Boolean), Optional cancellationToken As CancellationToken = Nothing) As Task(Of HealthReport)

参数

predicate
Func<HealthCheckRegistration,Boolean>

一个谓词,可用于包含基于用户定义的条件的运行状况检查。

cancellationToken
CancellationToken

可用于取消运行状况检查的 CancellationToken

返回

一个 Task<TResult>,将在运行所有运行状况检查后完成,并生成包含结果的 HealthReport

例外

取消令牌已取消。 此异常存储在返回的任务中。

适用于