コード例 #1
0
        public bool IsHealthEventReportingEnabled(string appName, System.Fabric.Health.HealthState aggregatedHealthState)
        {
            var healthEventsFilter = this.Filters.HealthEventsFilter;

            return(healthEventsFilter.IsEntityEnabled(appName) &&
                   healthEventsFilter.IsEntityEnabled(aggregatedHealthState));
        }
コード例 #2
0
ファイル: EntityHealth.cs プロジェクト: dkkapur/watchdogdemo
 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;
 }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: EntityHealth.cs プロジェクト: dkkapur/watchdogdemo
 internal EntityHealth(System.Fabric.Health.HealthState aggregatedHealthState)
 {
     this.AggregatedHealthState = aggregatedHealthState;
 }
コード例 #5
0
        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);
        }