24 instantiations of HealthCheckResult
Aspire.Azure.Messaging.WebPubSub (1)
Aspire.Azure.Search.Documents (1)
Aspire.Elastic.Clients.Elasticsearch (2)
Aspire.Hosting.Elasticsearch (2)
Aspire.Hosting.Nats (1)
Aspire.Hosting.Qdrant (2)
Aspire.Milvus.Client (2)
Aspire.NATS.Net (1)
Aspire.Qdrant.Client (2)
HealthChecksSample (3)
HealthChecksSandbox.AppHost (3)
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (3)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
212 references to HealthCheckResult
Aspire.Azure.Messaging.WebPubSub (2)
Aspire.Azure.Search.Documents (2)
Aspire.Elastic.Clients.Elasticsearch (2)
Aspire.Hosting.Azure.Tests (6)
Aspire.Hosting.Elasticsearch (2)
Aspire.Hosting.Elasticsearch.Tests (2)
Aspire.Hosting.Garnet.Tests (2)
Aspire.Hosting.Kafka.Tests (2)
Aspire.Hosting.MongoDB.Tests (2)
Aspire.Hosting.MySql.Tests (2)
Aspire.Hosting.Nats (6)
Aspire.Hosting.Nats.Tests (2)
Aspire.Hosting.Oracle.Tests (2)
Aspire.Hosting.PostgreSQL.Tests (2)
Aspire.Hosting.Qdrant (2)
Aspire.Hosting.Qdrant.Tests (2)
Aspire.Hosting.RabbitMQ.Tests (2)
Aspire.Hosting.Redis.Tests (2)
Aspire.Hosting.SqlServer.Tests (2)
Aspire.Hosting.Tests (10)
Aspire.Hosting.Valkey.Tests (2)
Aspire.Milvus.Client (2)
Aspire.NATS.Net (6)
Aspire.Qdrant.Client (2)
Aspire.RabbitMQ.Client (1)
Aspire.Seq (3)
CatalogDb (5)
HealthChecksSample (5)
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (20)
HealthCheckMiddlewareTests.cs (20)
171.AddCheck("Foo", () => HealthCheckResult.Healthy("A-ok!"))
172.AddCheck("Bar", () => HealthCheckResult.Healthy("A-ok!"))
173.AddCheck("Baz", () => HealthCheckResult.Healthy("A-ok!"));
204.AddCheck("Foo", () => HealthCheckResult.Healthy("A-ok!"))
205.AddCheck("Bar", () => HealthCheckResult.Degraded("Not so great."))
206.AddCheck("Baz", () => HealthCheckResult.Healthy("A-ok!"));
237.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")))
238.AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Unhealthy("Pretty bad.")))
239.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")));
270.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")))
272.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")));
316.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")))
317.AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Unhealthy("Pretty bad.")))
318.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")));
353.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")))
354.AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Unhealthy("Pretty bad.")))
355.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")));
490.AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")))
492.AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Unhealthy("A-ok!")))
493.AddAsyncCheck("Baz", () => Task.FromResult(HealthCheckResult.Healthy("A-ok!")));
Microsoft.Extensions.Diagnostics.HealthChecks (12)
DependencyInjection\HealthChecksBuilderDelegateExtensions.cs (8)
31Func<HealthCheckResult> check,
50Func<HealthCheckResult> check,
74Func<CancellationToken, HealthCheckResult> check,
93Func<CancellationToken, HealthCheckResult> check,
117Func<Task<HealthCheckResult>> check,
136Func<Task<HealthCheckResult>> check,
160Func<CancellationToken, Task<HealthCheckResult>> check,
179Func<CancellationToken, Task<HealthCheckResult>> check,
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (11)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (20)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (4)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (58)
DefaultHealthCheckServiceTest.cs (29)
34.AddCheck("Foo", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy())))
35.AddCheck("Foo", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy())))
36.AddCheck("Bar", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy())))
37.AddCheck("Baz", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy())))
38.AddCheck("Baz", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy())));
74b.AddAsyncCheck("HealthyCheck", _ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage, data)), healthyCheckTags);
75b.AddAsyncCheck("DegradedCheck", _ => Task.FromResult(HealthCheckResult.Degraded(DegradedMessage)), degradedCheckTags);
76b.AddAsyncCheck("UnhealthyCheck", _ => Task.FromResult(HealthCheckResult.Unhealthy(UnhealthyMessage, exception)), unhealthyCheckTags);
177b.AddAsyncCheck("HealthyCheck", _ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage, data)));
178b.AddAsyncCheck("DegradedCheck", _ => Task.FromResult(HealthCheckResult.Degraded(DegradedMessage)));
179b.AddAsyncCheck("UnhealthyCheck", _ => Task.FromResult(HealthCheckResult.Unhealthy(UnhealthyMessage, exception)));
257return HealthCheckResult.Unhealthy();
283b.AddAsyncCheck("Faults", ct => Task.FromException<HealthCheckResult>(faultedException));
284b.AddAsyncCheck("Succeeds", ct => Task.FromResult(HealthCheckResult.Healthy()));
334return Task.FromResult(HealthCheckResult.Healthy());
501return HealthCheckResult.Healthy();
508return HealthCheckResult.Healthy();
542return HealthCheckResult.Healthy();
568return HealthCheckResult.Healthy();
666public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
668return Task.FromResult(HealthCheckResult.Healthy());
681public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
686return Task.FromResult(HealthCheckResult.Healthy());
690return Task.FromResult(HealthCheckResult.Unhealthy("failed", e));
698public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
704return Task.FromResult(HealthCheckResult.Healthy(data: data));
710public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
734public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken)
736return Task.FromResult(HealthCheckResult.Healthy(data: new Dictionary<string, object> { { "self", this } }));
HealthCheckPublisherHostedServiceTest.cs (20)
251instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
258instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
270instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
282instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
297return Task.FromResult(HealthCheckResult.Healthy(HealthyMessage));
310instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
322instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
334instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
346instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
526instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
533instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
545instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
557instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
572return Task.FromResult(HealthCheckResult.Healthy(HealthyMessage));
585instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
597instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
609instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
621instance: new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage))),
749builder.AddCheck("one", () => { return HealthCheckResult.Healthy(); })
750.AddCheck("two", () => { return HealthCheckResult.Healthy(); });
OrleansServiceDefaults (1)
Playground.ServiceDefaults (1)
Seq.ServiceDefaults (1)
TestingAppHost1.ServiceDefaults (1)
TestShop.ServiceDefaults (1)