public bool IsHealthEventReportingEnabled(string appName, System.Fabric.Health.HealthState aggregatedHealthState) { var healthEventsFilter = this.Filters.HealthEventsFilter; return(healthEventsFilter.IsEntityEnabled(appName) && healthEventsFilter.IsEntityEnabled(aggregatedHealthState)); }
internal EntityHealth( System.Fabric.Health.HealthState aggregatedHealthState, IEnumerable <EntityHealthEvent> healthEvents, IList <System.Fabric.Health.HealthEvaluation> unhealthyEvaluations) { this.AggregatedHealthState = aggregatedHealthState; this.HealthEvents = healthEvents; this.UnhealthyEvaluations = unhealthyEvaluations; }
public async Task PublishAsync_ForReportWithValidHealthStatus_ReportsCorrectSfHealthState(string healthCheckName, HealthStatus healthCheckStatus, SfHealthState expectedSfHealthState) { // Arrange. PublisherTestContext testContext = new PublisherTestContext(); testContext.ConfigureStatefulServicePartition(); // Currently report status is calculated as the worst of all healthchecks. In .NET 5 it will be possible to set it independently. HealthReport report = new HealthReportBuilder() .AddEntry(healthCheckName, healthCheckStatus) .ToHealthReport(); // Act. await testContext.Publisher.PublishAsync(report, cancellationToken : default); // Assert. Assert.AreEqual(expectedSfHealthState, testContext.ReportedSfHealthInformation(ServiceFabricHealthCheckPublisher.HealthReportSummaryProperty)?.HealthState); }
internal EntityHealth(System.Fabric.Health.HealthState aggregatedHealthState) { this.AggregatedHealthState = aggregatedHealthState; }
public async Task PublishAsync_ForHealthCheckWithValidHealthStatus_ReportsCorrectSfHealthState(string healthCheckName, HealthStatus healthCheckStatus, SfHealthState expectedSfHealthState) { // Arrange. PublisherTestContext testContext = new PublisherTestContext(); testContext.ConfigureStatelessServicePartition(); HealthReport report = new HealthReportBuilder() .AddEntry(healthCheckName, healthCheckStatus) .ToHealthReport(); // Act. await testContext.Publisher.PublishAsync(report, cancellationToken : default); // Assert. Assert.AreEqual(expectedSfHealthState, testContext.ReportedSfHealthInformation(healthCheckName)?.HealthState); }