From b0020e93c0d43889f38a23abc57ce564a9e0c0c3 Mon Sep 17 00:00:00 2001 From: Karol Zadora-Przylecki Date: Thu, 13 Jul 2017 09:41:27 -0700 Subject: [PATCH] Build fixes 1. Eliminate warnings in EventFlowTelemetryProcessor 2. Increase pipeline completion timeouts in tests --- .../EventFlowTelemetryProcessor.cs | 2 +- .../DiagnosticPipelineTests.cs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.Diagnostics.EventFlow.Inputs.ApplicationInsights/EventFlowTelemetryProcessor.cs b/src/Microsoft.Diagnostics.EventFlow.Inputs.ApplicationInsights/EventFlowTelemetryProcessor.cs index af9684cb..784b4988 100644 --- a/src/Microsoft.Diagnostics.EventFlow.Inputs.ApplicationInsights/EventFlowTelemetryProcessor.cs +++ b/src/Microsoft.Diagnostics.EventFlow.Inputs.ApplicationInsights/EventFlowTelemetryProcessor.cs @@ -362,7 +362,7 @@ private void AddMetricProperties(IDictionary eventPayload, Metri { eventPayload.Add(TelemetryTypeProperty, "metric"); eventPayload.Add(nameof(metric.Name), metric.Name); - eventPayload.Add(nameof(metric.Value), metric.Value); + eventPayload.Add(nameof(metric.Sum), metric.Sum); if (metric.Count.HasValue) { eventPayload.Add(nameof(metric.Count), metric.Count.Value); diff --git a/test/Microsoft.Diagnostics.EventFlow.Core.Tests/DiagnosticPipelineTests.cs b/test/Microsoft.Diagnostics.EventFlow.Core.Tests/DiagnosticPipelineTests.cs index 5d6c1d03..7b04f37e 100644 --- a/test/Microsoft.Diagnostics.EventFlow.Core.Tests/DiagnosticPipelineTests.cs +++ b/test/Microsoft.Diagnostics.EventFlow.Core.Tests/DiagnosticPipelineTests.cs @@ -42,7 +42,7 @@ public void ShouldPassOneInputToOneOutput() DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration() { MaxBatchDelayMsec = 10, - PipelineCompletionTimeoutMsec = 1000 + PipelineCompletionTimeoutMsec = 5000 }; using (UnitTestInput unitTestInput = new UnitTestInput()) @@ -72,7 +72,7 @@ public void UsableIfBufferOverflowOccurs() DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration() { MaxBatchDelayMsec = 10, - PipelineCompletionTimeoutMsec = 1000, + PipelineCompletionTimeoutMsec = 5000, PipelineBufferSize = 1, MaxConcurrency = 1, MaxEventBatchSize = 1 @@ -130,7 +130,7 @@ public void UsableIfExceptionInGlobalFilterOccurs() DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration() { MaxBatchDelayMsec = 10, - PipelineCompletionTimeoutMsec = 1000, + PipelineCompletionTimeoutMsec = 5000, MaxEventBatchSize = 2 }; UnitTestFilter unitTestFilter = new UnitTestFilter(); @@ -172,7 +172,7 @@ public void UsableIfExceptionInOutputSpecificFilterOccurs() DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration() { MaxBatchDelayMsec = 10, - PipelineCompletionTimeoutMsec = 1000, + PipelineCompletionTimeoutMsec = 5000, MaxEventBatchSize = 2 }; UnitTestFilter unitTestFilter = new UnitTestFilter(); @@ -212,7 +212,7 @@ public void CanDisposePipelineStuckInAFilter() Mock healthReporterMock = new Mock(); UnitTestOutput unitTestOutput = new UnitTestOutput(); - const int CompletionTimeoutMsec = 1000; + const int CompletionTimeoutMsec = 5000; DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration() { MaxBatchDelayMsec = 10, @@ -259,7 +259,7 @@ public void CanDisposePipelineStuckInAnOutput() unitTestOutput.SendEventsDelay = TimeSpan.MaxValue; unitTestOutput.DisregardCancellationToken = true; - const int CompletionTimeoutMsec = 1000; + const int CompletionTimeoutMsec = 5000; DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration() { MaxBatchDelayMsec = 10, @@ -307,7 +307,7 @@ public void UsableIfExceptionInOutputOccurs() DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration() { MaxBatchDelayMsec = 10, - PipelineCompletionTimeoutMsec = 1000, + PipelineCompletionTimeoutMsec = 5000, MaxEventBatchSize = 2 }; const int TestEventCount = 32; @@ -353,7 +353,7 @@ public async Task WarnsAboutThrottlingIfOneSinkIsSlow() PipelineBufferSize = InputBufferSize, MaxEventBatchSize = 4, MaxConcurrency = 2, - PipelineCompletionTimeoutMsec = 1000 + PipelineCompletionTimeoutMsec = 5000 }; using (UnitTestInput unitTestInput = new UnitTestInput()) @@ -402,7 +402,7 @@ public async Task DoesNotWarnIfNoThrottlingOccurs() PipelineBufferSize = InputBufferSize, MaxEventBatchSize = 4, MaxConcurrency = 2, - PipelineCompletionTimeoutMsec = 1000 + PipelineCompletionTimeoutMsec = 5000 }; using (UnitTestInput unitTestInput = new UnitTestInput())