Derive status from allocated < options.Threshold (#15476)

pull/15477/head
Adam Williams 2019-11-03 23:03:51 +00:00 committed by Luke Latham
parent 394d2dbacc
commit 8e32c47786
1 changed files with 3 additions and 1 deletions

View File

@ -39,9 +39,11 @@ namespace SampleApp
{ "Gen1Collections", GC.CollectionCount(1) }, { "Gen1Collections", GC.CollectionCount(1) },
{ "Gen2Collections", GC.CollectionCount(2) }, { "Gen2Collections", GC.CollectionCount(2) },
}; };
var status = (allocated < options.Threshold) ?
HealthStatus.Healthy : context.Registration.FailureStatus;
return Task.FromResult(new HealthCheckResult( return Task.FromResult(new HealthCheckResult(
context.Registration.FailureStatus, status,
description: "Reports degraded status if allocated bytes " + description: "Reports degraded status if allocated bytes " +
$">= {options.Threshold} bytes.", $">= {options.Threshold} bytes.",
exception: null, exception: null,