Azure service fabric 健康报告陷入困境

Azure service fabric 健康报告陷入困境,azure-service-fabric,Azure Service Fabric,在一个简单的无状态服务中,我试图报告运行状况。作为测试,我只是在RunAsync中循环的每次迭代中在OK和Warning状态之间切换(它的睡眠间隔为15秒)。代码如下所示: // report warning on odd iterations HealthState state = ((++iterations % 2) != 0) ? HealthState.Warning : HealthState.Ok; HealthInformation health = new HealthInfo

在一个简单的无状态服务中,我试图报告运行状况。作为测试,我只是在RunAsync中循环的每次迭代中在OK和Warning状态之间切换(它的睡眠间隔为15秒)。代码如下所示:

// report warning on odd iterations
HealthState state = ((++iterations % 2) != 0) ? HealthState.Warning : HealthState.Ok;
HealthInformation health = new HealthInformation("ServiceCode", "Iteration", state);
Partition.ReportInstanceHealth(health);
我在循环的每个迭代中记录状态,日志显示它来回翻转。但在SF浏览器中,它一直处于Ok状态,从不切换到Warning(我在SFExplorer中的刷新间隔为5秒)


我做错了什么?

尝试指定HealthInformation.SequenceNumber,并为每个状态更改指定一个增量值。

看起来运行状况报告比我预期的要慢得多。在15秒的时间间隔内工作,不足以显示交替的健康状态。移动到30秒的间隔似乎解决了这个问题