Class MemoryHealthCheck
- Namespace
- JD.AI.Telemetry.HealthChecks
- Assembly
- JD.AI.Telemetry.dll
Health check that monitors managed heap memory usage. Reports Degraded when the managed heap exceeds the configured threshold (default: 1 GB).
public sealed class MemoryHealthCheck : IHealthCheck
- Inheritance
-
MemoryHealthCheck
- Implements
- Inherited Members
Constructors
MemoryHealthCheck(int)
public MemoryHealthCheck(int maximumMegabytes = 1024)
Parameters
maximumMegabytesintMaximum managed heap size in MB before reporting Degraded.
Methods
CheckHealthAsync(HealthCheckContext, CancellationToken)
Runs the health check, returning the status of the component being checked.
public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
Parameters
contextHealthCheckContextA context object associated with the current execution.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the health check.
Returns
- Task<HealthCheckResult>
A Task<TResult> that completes when the health check has finished, yielding the status of the component being checked.