From e7de840dea2ddb50d6f7c48133e00e1fd91ae720 Mon Sep 17 00:00:00 2001 From: chynesNR Date: Mon, 21 Oct 2024 08:58:54 -0700 Subject: [PATCH 1/3] test: Make metric validation more consistent --- .../AgentMetrics/RequiredSupportabilityMetrics.cs | 4 ++-- .../IntegrationTests/Api/ApiCallsTests.cs | 2 +- .../AspNetCoreCollectibleAssemblyContextTests.cs | 8 ++++---- .../AspNetCore/AspNetCoreMvcCoreFrameworkTests.cs | 14 +++++++------- .../AzureFunction/AzureFunctionHttpTriggerTests.cs | 12 ++++++------ .../BasicInstrumentation/BasicWebForms.cs | 10 +++++----- .../BasicInstrumentation/BasicWebService.cs | 10 +++++----- .../BasicInstrumentation/ServiceStackRedisTests.cs | 4 ++-- .../AttributeInstrumentationTests.cs | 10 +++++----- .../DTSupportabilityMetricTests.cs | 2 +- .../DistributedTracing/DistributedTraceApiTests.cs | 2 +- .../HttpClientW3CTestsNetCore.cs | 4 ++-- .../IntegrationTests/Errors/ErrorTraceWebApi.cs | 2 +- .../Errors/ErrorTraceWebService.cs | 12 ++++++------ .../HttpClientInstrumentation.cs | 4 ++-- .../Logging/HSMOrCSPDisablesForwardingTests.cs | 2 +- .../Logging/LogLevelDenyListTests.cs | 6 +++--- .../Logging/MetricsAndForwardingTests.cs | 12 ++++++------ .../MassTransit/MassTransitTests.cs | 10 +++++----- .../IntegrationTests/Owin/OwinDTChainTests.cs | 4 ++-- .../IntegrationTests/Owin/OwinWebApiAsyncTests.cs | 2 +- .../IntegrationTests/Owin/OwinWebApiTests.cs | 10 +++++----- .../ReJit/NetCore/AddIgnoredInstrumentation.cs | 2 +- .../ReJit/NetCore/RejitAddAttribute.cs | 2 +- .../IntegrationTests/ReJit/NetCore/RejitAddFile.cs | 2 +- .../IntegrationTests/ReJit/NetCore/RejitAddNode.cs | 8 ++++---- .../ReJit/NetCore/RejitChangeAttributeValue.cs | 2 +- .../ReJit/NetCore/RejitDeleteAttribute.cs | 2 +- .../ReJit/NetCore/RejitDeleteFile.cs | 2 +- .../ReJit/NetCore/RejitDeleteNode.cs | 10 +++++----- .../ReJit/NetCore/RejitRenameFile.cs | 8 ++++---- .../ReJit/NetCore/RemoveIgnoredInstrumentation.cs | 2 +- .../NetFramework/RemoveIgnoredInstrumentation.cs | 2 +- .../IntegrationTests/RequestHandling/BaseTests.cs | 2 +- .../RestSharpClientInstrumentationAsyncAwaitCAT.cs | 2 +- .../RestSharp/RestSharpClientInstrumentationCAT.cs | 4 ++-- ...SharpClientInstrumentationDistributedTracing.cs | 4 ++-- .../RestSharpClientInstrumentationTaskResultCAT.cs | 2 +- .../IntegrationTests/WCF/WCFClientTests.cs | 8 ++++---- 39 files changed, 105 insertions(+), 105 deletions(-) diff --git a/tests/Agent/IntegrationTests/IntegrationTests/AgentMetrics/RequiredSupportabilityMetrics.cs b/tests/Agent/IntegrationTests/IntegrationTests/AgentMetrics/RequiredSupportabilityMetrics.cs index bb0112ae36..d027b668bd 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/AgentMetrics/RequiredSupportabilityMetrics.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/AgentMetrics/RequiredSupportabilityMetrics.cs @@ -54,8 +54,8 @@ public void Test() var expectedMetrics = new List { new Assertions.ExpectedMetric { metricName = @"Supportability/MetricHarvest/transmit", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = 4 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSent", callCount = 4 }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = 4 }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSent", CallCountAllHarvests = 4 }, }; var metrics = _fixture.AgentLog.GetMetrics().ToList(); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Api/ApiCallsTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/Api/ApiCallsTests.cs index 4b6d564873..3591333f81 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Api/ApiCallsTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Api/ApiCallsTests.cs @@ -71,7 +71,7 @@ public void ExpectedMetrics() { new Assertions.ExpectedMetric(){ callCount = 1, metricName = "Supportability/ApiInvocation/TraceMetadata" }, new Assertions.ExpectedMetric(){ callCount = 1, metricName = "Supportability/ApiInvocation/GetLinkingMetadata"}, - new Assertions.ExpectedMetric(){ callCount = 2, metricName = "Supportability/ApiInvocation/StartDatastoreSegment"} + new Assertions.ExpectedMetric(){ CallCountAllHarvests = 2, metricName = "Supportability/ApiInvocation/StartDatastoreSegment"} }; var actualMetrics = Fixture.AgentLog.GetMetrics().ToList(); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreCollectibleAssemblyContextTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreCollectibleAssemblyContextTests.cs index 722c148826..12ab8743ea 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreCollectibleAssemblyContextTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreCollectibleAssemblyContextTests.cs @@ -69,14 +69,14 @@ public void Test() private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/ApiInvocation/CurrentTransaction", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/ApiInvocation/InsertDistributedTraceHeaders", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/ApiInvocation/CurrentTransaction", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/ApiInvocation/InsertDistributedTraceHeaders", CallCountAllHarvests = ExpectedTransactionCount }, }; private readonly List _collectibleMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"DotNet/CollectibleController/AccessCollectible", callCount = 2 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/CollectibleController/AccessCollectible", metricScope = @"WebTransaction/MVC/Collectible/AccessCollectible", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/CollectibleController/AccessCollectible", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/CollectibleController/AccessCollectible", metricScope = @"WebTransaction/MVC/Collectible/AccessCollectible", CallCountAllHarvests = 2 }, }; } } diff --git a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcCoreFrameworkTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcCoreFrameworkTests.cs index 8e523e2c4c..6744ae559d 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcCoreFrameworkTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcCoreFrameworkTests.cs @@ -45,13 +45,13 @@ public void Test() { var expectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = 2 }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = 2 }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction/MVC/Values/Get", callCount = 2 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", callCount = 2 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", metricScope = @"WebTransaction/MVC/Values/Get", callCount = 2 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/ValuesController/Get", callCount = 2 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/ValuesController/Get", metricScope = @"WebTransaction/MVC/Values/Get", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction/MVC/Values/Get", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", metricScope = @"WebTransaction/MVC/Values/Get", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/ValuesController/Get", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/ValuesController/Get", metricScope = @"WebTransaction/MVC/Values/Get", CallCountAllHarvests = 2 }, }; var metrics = _fixture.AgentLog.GetMetrics().ToList(); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/AzureFunction/AzureFunctionHttpTriggerTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/AzureFunction/AzureFunctionHttpTriggerTests.cs index f53bef9d22..33921c0535 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/AzureFunction/AzureFunctionHttpTriggerTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/AzureFunction/AzureFunctionHttpTriggerTests.cs @@ -101,9 +101,9 @@ public void Test_SimpleInvocationMode() var simpleTransactionName = "WebTransaction/AzureFunction/HttpTriggerFunctionUsingSimpleInvocation"; var simpleExpectedMetrics = new List() { - new() {metricName = "DotNet/HttpTriggerFunctionUsingSimpleInvocation", callCount = 2}, - new() {metricName = "DotNet/HttpTriggerFunctionUsingSimpleInvocation", metricScope = simpleTransactionName, callCount = 2}, - new() {metricName = simpleTransactionName, callCount = 2}, + new() {metricName = "DotNet/HttpTriggerFunctionUsingSimpleInvocation", CallCountAllHarvests = 2}, + new() {metricName = "DotNet/HttpTriggerFunctionUsingSimpleInvocation", metricScope = simpleTransactionName, CallCountAllHarvests = 2}, + new() {metricName = simpleTransactionName, CallCountAllHarvests = 2}, }; var transactionSample = _fixture.AgentLog.TryGetTransactionSample(simpleTransactionName); @@ -195,9 +195,9 @@ public void Test_PipelineMode() var pipelineTransactionName = "WebTransaction/AzureFunction/HttpTriggerFunctionUsingAspNetCorePipeline"; var pipelineExpectedMetrics = new List() { - new() {metricName = "DotNet/HttpTriggerFunctionUsingAspNetCorePipeline", callCount = 2}, - new() {metricName = "DotNet/HttpTriggerFunctionUsingAspNetCorePipeline", metricScope = pipelineTransactionName, callCount = 2}, - new() {metricName = pipelineTransactionName, callCount = 2}, + new() {metricName = "DotNet/HttpTriggerFunctionUsingAspNetCorePipeline", CallCountAllHarvests = 2}, + new() {metricName = "DotNet/HttpTriggerFunctionUsingAspNetCorePipeline", metricScope = pipelineTransactionName, CallCountAllHarvests = 2}, + new() {metricName = pipelineTransactionName, CallCountAllHarvests = 2}, }; var simpleTransactionName = "WebTransaction/AzureFunction/HttpTriggerFunctionUsingSimpleInvocation"; diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/BasicWebForms.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/BasicWebForms.cs index 7a95fb6eda..eed74e7a0c 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/BasicWebForms.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/BasicWebForms.cs @@ -46,11 +46,11 @@ public void Test() { var expectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = 3 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = 3 }, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = 3 }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = 3 }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = 3 } + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = 3 }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = 3 }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = 3 }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = 3 }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = 3 } }; foreach (var webFormName in new List() { "webform1.aspx", "webformslow.aspx"} ) diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/BasicWebService.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/BasicWebService.cs index 22e246f22c..29586ad12b 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/BasicWebService.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/BasicWebService.cs @@ -43,11 +43,11 @@ public void Test() { var expectedMetrics = new List { - new Assertions.ExpectedMetric {metricName = @"DotNet/System.Web.Services.Protocols.SyncSessionlessHandler/ProcessRequest", callCount = 2 }, - new Assertions.ExpectedMetric {metricName = @"DotNet/System.Web.Services.Protocols.SyncSessionlessHandler/ProcessRequest", metricScope = "WebTransaction/WebService/BasicWebService.TestWebService.HelloWorld", callCount = 2}, - new Assertions.ExpectedMetric {metricName = @"WebTransaction/WebService/BasicWebService.TestWebService.HelloWorld", callCount = 2}, - new Assertions.ExpectedMetric {metricName = @"DotNet/BasicWebService.TestWebService.HelloWorld", callCount = 2}, - new Assertions.ExpectedMetric {metricName = @"DotNet/BasicWebService.TestWebService.HelloWorld", metricScope = "WebTransaction/WebService/BasicWebService.TestWebService.HelloWorld", callCount = 2} + new Assertions.ExpectedMetric {metricName = @"DotNet/System.Web.Services.Protocols.SyncSessionlessHandler/ProcessRequest", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric {metricName = @"DotNet/System.Web.Services.Protocols.SyncSessionlessHandler/ProcessRequest", metricScope = "WebTransaction/WebService/BasicWebService.TestWebService.HelloWorld", CallCountAllHarvests = 2}, + new Assertions.ExpectedMetric {metricName = @"WebTransaction/WebService/BasicWebService.TestWebService.HelloWorld", CallCountAllHarvests = 2}, + new Assertions.ExpectedMetric {metricName = @"DotNet/BasicWebService.TestWebService.HelloWorld", CallCountAllHarvests = 2}, + new Assertions.ExpectedMetric {metricName = @"DotNet/BasicWebService.TestWebService.HelloWorld", metricScope = "WebTransaction/WebService/BasicWebService.TestWebService.HelloWorld", CallCountAllHarvests = 2} }; var expectedTransactionTraceSegments = new List diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ServiceStackRedisTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ServiceStackRedisTests.cs index 59749a7794..914da55c86 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ServiceStackRedisTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ServiceStackRedisTests.cs @@ -36,8 +36,8 @@ public void Test() { var expectedMetrics = new List() { - new Assertions.ExpectedMetric {metricName = "Datastore/all", callCount = 3}, - new Assertions.ExpectedMetric {metricName = "Datastore/Redis/all", callCount = 3}, + new Assertions.ExpectedMetric {metricName = "Datastore/all", CallCountAllHarvests = 3}, + new Assertions.ExpectedMetric {metricName = "Datastore/Redis/all", CallCountAllHarvests = 3}, new Assertions.ExpectedMetric {metricName = "Datastore/operation/Redis/" + ServiceStackRedisCommands.SaveAsync, callCount = 1}, new Assertions.ExpectedMetric {metricName = "Datastore/operation/Redis/" + ServiceStackRedisCommands.SaveAsync, metricScope = "WebTransaction/MVC/RedisController/Get", callCount = 1}, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/CustomInstrumentation/AttributeInstrumentationTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/CustomInstrumentation/AttributeInstrumentationTests.cs index da6e32617c..9c285d8dad 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/CustomInstrumentation/AttributeInstrumentationTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/CustomInstrumentation/AttributeInstrumentationTests.cs @@ -78,12 +78,12 @@ public void Test() { var expectedMetrics = new List { - new Assertions.ExpectedMetric {metricName = $"WebTransaction", callCount = 2}, - new Assertions.ExpectedMetric {metricName = $"OtherTransaction/all", callCount = 4}, + new Assertions.ExpectedMetric {metricName = $"WebTransaction", CallCountAllHarvests = 2}, + new Assertions.ExpectedMetric {metricName = $"OtherTransaction/all", CallCountAllHarvests = 4}, - new Assertions.ExpectedMetric {metricName = $"DotNet/{LibraryClassName}/DoSomeWork", callCount = 3}, - new Assertions.ExpectedMetric {metricName = $"DotNet/{LibraryClassName}/DoSomeWorkAsync", callCount = 2}, - new Assertions.ExpectedMetric {metricName = $"DotNet/{LibraryClassName}/DoSomeMoreWorkAsync", callCount = 2}, + new Assertions.ExpectedMetric {metricName = $"DotNet/{LibraryClassName}/DoSomeWork", CallCountAllHarvests = 3}, + new Assertions.ExpectedMetric {metricName = $"DotNet/{LibraryClassName}/DoSomeWorkAsync", CallCountAllHarvests = 2}, + new Assertions.ExpectedMetric {metricName = $"DotNet/{LibraryClassName}/DoSomeMoreWorkAsync", CallCountAllHarvests = 2}, new Assertions.ExpectedMetric {metricName = $"WebTransaction/Custom/{LibraryClassName}/MakeWebTransaction", callCount = 1}, new Assertions.ExpectedMetric {metricName = $"DotNet/{LibraryClassName}/MakeWebTransaction", callCount = 1}, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/DTSupportabilityMetricTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/DTSupportabilityMetricTests.cs index 2eec965a2f..0a53ae0ee7 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/DTSupportabilityMetricTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/DTSupportabilityMetricTests.cs @@ -53,7 +53,7 @@ public void Test() new Assertions.ExpectedMetric { metricName = @"Supportability/DistributedTrace/AcceptPayload/Ignored/Null", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Supportability/DistributedTrace/AcceptPayload/ParseException", callCount = 1 }, // The methods for GenerateAcceptSuccessMetric and GenerateCreateSuccessMetric result in AcceptPayload/Success metrics so we should look for two. - new Assertions.ExpectedMetric { metricName = @"Supportability/DistributedTrace/AcceptPayload/Success", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"Supportability/DistributedTrace/AcceptPayload/Success", CallCountAllHarvests = 2 }, new Assertions.ExpectedMetric { metricName = @"Supportability/DistributedTrace/AcceptPayload/Ignored/UntrustedAccount", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Supportability/DistributedTrace/CreatePayload/Success", callCount = 1 }, }; diff --git a/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/DistributedTraceApiTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/DistributedTraceApiTests.cs index 147d398f99..d1f55af8e9 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/DistributedTraceApiTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/DistributedTraceApiTests.cs @@ -26,7 +26,7 @@ public override void Metrics() { new Assertions.ExpectedMetric { metricName = @"Supportability/ApiInvocation/InsertDistributedTraceHeaders", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Supportability/ApiInvocation/AcceptDistributedTraceHeaders", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/ApiInvocation/CurrentTransaction", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"Supportability/ApiInvocation/CurrentTransaction", CallCountAllHarvests = 2 }, new Assertions.ExpectedMetric { metricName = @"Supportability/TraceContext/Accept/Success", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Supportability/TraceContext/Create/Success", callCount = 1 }, }; diff --git a/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/W3CInstrumentationTests/HttpClientW3CTestsNetCore.cs b/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/W3CInstrumentationTests/HttpClientW3CTestsNetCore.cs index 7a6473df16..59876e28bc 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/W3CInstrumentationTests/HttpClientW3CTestsNetCore.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/DistributedTracing/W3CInstrumentationTests/HttpClientW3CTestsNetCore.cs @@ -120,7 +120,7 @@ public void Test() var senderExpectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/SpanEvent/TotalEventsSeen", callCount = 4 }, + new Assertions.ExpectedMetric { metricName = @"Supportability/SpanEvent/TotalEventsSeen", CallCountAllHarvests = 4 }, new Assertions.ExpectedMetric { metricName = @"Supportability/TraceContext/Accept/Success", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Supportability/TraceContext/Create/Success", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Supportability/TraceContext/TraceState/NoNrEntry", callCount = 1 } @@ -136,7 +136,7 @@ public void Test() var receiverExpectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/SpanEvent/TotalEventsSeen", callCount = 4 }, + new Assertions.ExpectedMetric { metricName = @"Supportability/SpanEvent/TotalEventsSeen", CallCountAllHarvests = 4 }, new Assertions.ExpectedMetric { metricName = @"Supportability/TraceContext/Accept/Success", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Supportability/TraceContext/Create/Success", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $@"DurationByCaller/App/{accountId}/{appId}/HTTP/all", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Errors/ErrorTraceWebApi.cs b/tests/Agent/IntegrationTests/IntegrationTests/Errors/ErrorTraceWebApi.cs index 2a5ac14c7e..c4fe8fb414 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Errors/ErrorTraceWebApi.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Errors/ErrorTraceWebApi.cs @@ -61,7 +61,7 @@ public void Test() var unexpectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", callCount = 5 }, + new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", CallCountAllHarvests = 5 }, }; var metrics = _fixture.AgentLog.GetMetrics().ToList(); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Errors/ErrorTraceWebService.cs b/tests/Agent/IntegrationTests/IntegrationTests/Errors/ErrorTraceWebService.cs index 01b49eadb5..53d56105cd 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Errors/ErrorTraceWebService.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Errors/ErrorTraceWebService.cs @@ -53,14 +53,14 @@ public void Test() var expectedMetrics = new List { // error metrics - new Assertions.ExpectedMetric {metricName = @"Errors/all", callCount = 2}, - new Assertions.ExpectedMetric {metricName = @"Errors/allWeb", callCount = 2}, - new Assertions.ExpectedMetric {metricName = @"Errors/WebTransaction/WebService/BasicWebService.TestWebService.ThrowException", callCount = 2}, + new Assertions.ExpectedMetric {metricName = @"Errors/all", CallCountAllHarvests = 2}, + new Assertions.ExpectedMetric {metricName = @"Errors/allWeb", CallCountAllHarvests = 2}, + new Assertions.ExpectedMetric {metricName = @"Errors/WebTransaction/WebService/BasicWebService.TestWebService.ThrowException", CallCountAllHarvests = 2}, // other - new Assertions.ExpectedMetric {metricName = @"WebTransaction/WebService/BasicWebService.TestWebService.ThrowException", callCount = 2}, - new Assertions.ExpectedMetric {metricName = @"DotNet/BasicWebService.TestWebService.ThrowException", callCount = 2}, - new Assertions.ExpectedMetric {metricName = @"DotNet/BasicWebService.TestWebService.ThrowException", metricScope = "WebTransaction/WebService/BasicWebService.TestWebService.ThrowException", callCount = 2} + new Assertions.ExpectedMetric {metricName = @"WebTransaction/WebService/BasicWebService.TestWebService.ThrowException", CallCountAllHarvests = 2}, + new Assertions.ExpectedMetric {metricName = @"DotNet/BasicWebService.TestWebService.ThrowException", CallCountAllHarvests = 2}, + new Assertions.ExpectedMetric {metricName = @"DotNet/BasicWebService.TestWebService.ThrowException", metricScope = "WebTransaction/WebService/BasicWebService.TestWebService.ThrowException", CallCountAllHarvests = 2} }; var unexpectedMetrics = new List diff --git a/tests/Agent/IntegrationTests/IntegrationTests/HttpClientInstrumentation/HttpClientInstrumentation.cs b/tests/Agent/IntegrationTests/IntegrationTests/HttpClientInstrumentation/HttpClientInstrumentation.cs index 37acb99ff4..c4721fe5e5 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/HttpClientInstrumentation/HttpClientInstrumentation.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/HttpClientInstrumentation/HttpClientInstrumentation.cs @@ -55,8 +55,8 @@ public void Test() { var expectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"External/all", callCount = 3 }, - new Assertions.ExpectedMetric { metricName = @"External/allOther", callCount = 3 }, + new Assertions.ExpectedMetric { metricName = @"External/all", CallCountAllHarvests = 3 }, + new Assertions.ExpectedMetric { metricName = @"External/allOther", CallCountAllHarvests = 3 }, new Assertions.ExpectedMetric { metricName = @"External/www.google.com/all", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"External/www.google.com/Stream/GET", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"External/www.google.com/Stream/GET", metricScope = @"OtherTransaction/Custom/MultiFunctionApplicationHelpers.NetStandardLibraries.Internal.HttpClientDriver/Get", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Logging/HSMOrCSPDisablesForwardingTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/Logging/HSMOrCSPDisablesForwardingTests.cs index abb700e36e..01613a22a6 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Logging/HSMOrCSPDisablesForwardingTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Logging/HSMOrCSPDisablesForwardingTests.cs @@ -60,7 +60,7 @@ public void NoLogDataIsSent() // Making sure logging metrics aren't disabled var loggingMetrics = new List { - new Assertions.ExpectedMetric { metricName = "Logging/lines", callCount = 5 }, + new Assertions.ExpectedMetric { metricName = "Logging/lines", CallCountAllHarvests = 5 }, }; var actualMetrics = _fixture.AgentLog.GetMetrics(); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Logging/LogLevelDenyListTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/Logging/LogLevelDenyListTests.cs index 213b65bb88..f3644df8ed 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Logging/LogLevelDenyListTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Logging/LogLevelDenyListTests.cs @@ -1,4 +1,4 @@ -// Copyright 2020 New Relic, Inc. All rights reserved. +// Copyright 2020 New Relic, Inc. All rights reserved. // SPDX-License-Identifier: Apache-2.0 using System; @@ -64,12 +64,12 @@ public void LoggingMetricsExist() new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "WARN"), callCount = 1 }, new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "ERROR"), callCount = 1 }, - new Assertions.ExpectedMetric { metricName = "Logging/lines", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = "Logging/lines", CallCountAllHarvests = 2 }, new Assertions.ExpectedMetric { metricName = "Logging/denied/" + LogUtils.GetLevelName(_loggingFramework, "DEBUG"), callCount = 1 }, new Assertions.ExpectedMetric { metricName = "Logging/denied/" + LogUtils.GetLevelName(_loggingFramework, "INFO"), callCount = 1 }, - new Assertions.ExpectedMetric { metricName = "Logging/denied", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = "Logging/denied", CallCountAllHarvests = 2 }, }; var notExpectedMetrics = new List { diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Logging/MetricsAndForwardingTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/Logging/MetricsAndForwardingTests.cs index 834052dda8..416f454aab 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Logging/MetricsAndForwardingTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Logging/MetricsAndForwardingTests.cs @@ -1,4 +1,4 @@ -// Copyright 2020 New Relic, Inc. All rights reserved. +// Copyright 2020 New Relic, Inc. All rights reserved. // SPDX-License-Identifier: Apache-2.0 using System; @@ -107,12 +107,12 @@ public void LogLinesPerLevelMetricsExist() { var loggingMetrics = new List { - new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "DEBUG"), callCount = 2 }, - new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "INFO"), callCount = 7 }, - new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "WARN"), callCount = 2 }, - new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "ERROR"), callCount = 6 }, + new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "DEBUG"), CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "INFO"), CallCountAllHarvests = 7 }, + new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "WARN"), CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = "Logging/lines/" + LogUtils.GetLevelName(_loggingFramework, "ERROR"), CallCountAllHarvests = 6 }, - new Assertions.ExpectedMetric { metricName = "Logging/lines", callCount = 17 }, + new Assertions.ExpectedMetric { metricName = "Logging/lines", CallCountAllHarvests = 17 }, }; var actualMetrics = _fixture.AgentLog.GetMetrics(); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/MassTransit/MassTransitTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/MassTransit/MassTransitTests.cs index ab2393343e..3ebe5fceb6 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/MassTransit/MassTransitTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/MassTransit/MassTransitTests.cs @@ -74,12 +74,12 @@ public void Test() var expectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = massTransitConsumeMetricNameRegex, callCount = 4, IsRegexName = true}, - new Assertions.ExpectedMetric { metricName = massTransitProduceMetricNameRegex, callCount = 4, IsRegexName = true}, + new Assertions.ExpectedMetric { metricName = massTransitConsumeMetricNameRegex, CallCountAllHarvests = 4, IsRegexName = true}, + new Assertions.ExpectedMetric { metricName = massTransitProduceMetricNameRegex, CallCountAllHarvests = 4, IsRegexName = true}, - new Assertions.ExpectedMetric { metricName = massTransitConsumeMetricNameRegex, callCount = 4, IsRegexName = true, metricScope = @"OtherTransaction\/Message\/MassTransit\/Queue\/" + queueNameRegex, IsRegexScope = true}, - new Assertions.ExpectedMetric { metricName = massTransitProduceMetricNameRegex, callCount = 2, IsRegexName = true, metricScope = "OtherTransaction/Custom/MultiFunctionApplicationHelpers.NetStandardLibraries.MassTransitExerciser/Publish"}, - new Assertions.ExpectedMetric { metricName = massTransitProduceMetricNameRegex, callCount = 2, IsRegexName = true, metricScope = "OtherTransaction/Custom/MultiFunctionApplicationHelpers.NetStandardLibraries.MassTransitExerciser/Send"}, + new Assertions.ExpectedMetric { metricName = massTransitConsumeMetricNameRegex, CallCountAllHarvests = 4, IsRegexName = true, metricScope = @"OtherTransaction\/Message\/MassTransit\/Queue\/" + queueNameRegex, IsRegexScope = true}, + new Assertions.ExpectedMetric { metricName = massTransitProduceMetricNameRegex, CallCountAllHarvests = 2, IsRegexName = true, metricScope = "OtherTransaction/Custom/MultiFunctionApplicationHelpers.NetStandardLibraries.MassTransitExerciser/Publish"}, + new Assertions.ExpectedMetric { metricName = massTransitProduceMetricNameRegex, CallCountAllHarvests = 2, IsRegexName = true, metricScope = "OtherTransaction/Custom/MultiFunctionApplicationHelpers.NetStandardLibraries.MassTransitExerciser/Send"}, }; Assertions.MetricsExist(expectedMetrics, metrics); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinDTChainTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinDTChainTests.cs index e27b89f35a..3f5742a1c5 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinDTChainTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinDTChainTests.cs @@ -91,7 +91,7 @@ public void Test() new Assertions.ExpectedMetric { metricName = @"Supportability/DistributedTrace/CreatePayload/Success", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Supportability/TraceContext/Create/Success", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/SpanEvent/TotalEventsSeen", callCount = 4 }, + new Assertions.ExpectedMetric { metricName = @"Supportability/SpanEvent/TotalEventsSeen", CallCountAllHarvests = 4 }, new Assertions.ExpectedMetric { metricName = @"DurationByCaller/Unknown/Unknown/Unknown/HTTP/all", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"DurationByCaller/Unknown/Unknown/Unknown/HTTP/allWeb", callCount = 1 }, @@ -105,7 +105,7 @@ public void Test() var receiverExpectedMetrics = new List { new Assertions.ExpectedMetric { metricName = @"Supportability/TraceContext/Accept/Success", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/SpanEvent/TotalEventsSeen", callCount = 3 }, + new Assertions.ExpectedMetric { metricName = @"Supportability/SpanEvent/TotalEventsSeen", CallCountAllHarvests = 3 }, new Assertions.ExpectedMetric { metricName = $"DurationByCaller/App/{acctId}/{appId}/HTTP/all", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $"DurationByCaller/App/{acctId}/{appId}/HTTP/allWeb", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinWebApiAsyncTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinWebApiAsyncTests.cs index f68693ddc0..3349930fe0 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinWebApiAsyncTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinWebApiAsyncTests.cs @@ -87,7 +87,7 @@ public void Test() new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"DotNet/Owin Middleware Pipeline", CallCountAllHarvests = ExpectedTransactionCount }, }; diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinWebApiTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinWebApiTests.cs index 9ebcd9f367..1e7a8ce6e5 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinWebApiTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Owin/OwinWebApiTests.cs @@ -56,12 +56,12 @@ public void Test() { var expectedMetrics = new List { - new Assertions.ExpectedMetric {metricName = @"DotNet/Owin Middleware Pipeline", callCount = 5}, - new Assertions.ExpectedMetric {metricName = @"WebTransaction", callCount = 5}, - new Assertions.ExpectedMetric {metricName = @"WebTransaction/WebAPI/Values/Get", callCount = 3}, + new Assertions.ExpectedMetric {metricName = @"DotNet/Owin Middleware Pipeline", CallCountAllHarvests = 5}, + new Assertions.ExpectedMetric {metricName = @"WebTransaction", CallCountAllHarvests = 5}, + new Assertions.ExpectedMetric {metricName = @"WebTransaction/WebAPI/Values/Get", CallCountAllHarvests = 3}, new Assertions.ExpectedMetric {metricName = @"WebTransaction/WebAPI/Values/Post", callCount = 1}, new Assertions.ExpectedMetric {metricName = @"WebTransaction/WebAPI/Values/Get404", callCount = 1}, - new Assertions.ExpectedMetric {metricName = @"DotNet/Values/Get", callCount = 3}, + new Assertions.ExpectedMetric {metricName = @"DotNet/Values/Get", CallCountAllHarvests = 3}, new Assertions.ExpectedMetric {metricName = @"DotNet/Values/Post", callCount = 1}, new Assertions.ExpectedMetric {metricName = @"DotNet/Values/Get404", callCount = 1}, new Assertions.ExpectedMetric {metricName = @"External/all", callCount = 1}, @@ -71,7 +71,7 @@ public void Test() }; var unexpectedMetrics = new List { - new Assertions.ExpectedMetric {metricName = @"OtherTransaction/all", callCount = 5}, + new Assertions.ExpectedMetric {metricName = @"OtherTransaction/all", CallCountAllHarvests = 5}, }; var metrics = _fixture.AgentLog.GetMetrics().ToList(); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/AddIgnoredInstrumentation.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/AddIgnoredInstrumentation.cs index 3f6124b9b6..e8d51f82b6 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/AddIgnoredInstrumentation.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/AddIgnoredInstrumentation.cs @@ -73,7 +73,7 @@ public void Test() // From the initialize call new Assertions.ExpectedMetric { metricName = @"WebTransaction/MVC/Home/Index", callCount = 1 }, // From the first 2 calls to TestAddNode - new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomAddMetricName", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomAddMetricName", CallCountAllHarvests = 2 }, // From the second set of calls after the mvc and custom instrumentations are disabled new Assertions.ExpectedMetric { metricName = @"WebTransaction/ASP/Rejit/GetAddNode/0", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"WebTransaction/ASP/Rejit/GetAddNode/1", callCount = 1 } diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddAttribute.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddAttribute.cs index 8af7f7b8c6..a3a4782682 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddAttribute.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddAttribute.cs @@ -69,7 +69,7 @@ public void Test() // Unscoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomAddAfterMetricName", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetAddAttribute", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetAddAttribute", CallCountAllHarvests = 2 }, // Scoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", metricScope = "WebTransaction/MVC/Home/Index", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddFile.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddFile.cs index d76b184cfc..5cf0668593 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddFile.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddFile.cs @@ -84,7 +84,7 @@ public void Test() expectedMetrics.Add(new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomAddMetricName", callCount = 1 }); expectedMetrics.Add(new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomAddMetricName", callCount = 1 }); expectedMetrics.Add(new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomAddMetricName", metricScope = "WebTransaction/Custom/MyCustomAddMetricName", callCount = 1 }); - expectedMetrics.Add(new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetAddFile", callCount = 2 }); + expectedMetrics.Add(new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetAddFile", CallCountAllHarvests = 2 }); } var metrics = CommonUtils.GetMetrics(_fixture.AgentLog); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddNode.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddNode.cs index c13d99f620..68d051f5f9 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddNode.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitAddNode.cs @@ -65,17 +65,17 @@ public void Test() { //transactions new Assertions.ExpectedMetric { metricName = @"WebTransaction/MVC/Home/Index", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomAddMetricName", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomAddMetricName", CallCountAllHarvests = 2 }, new Assertions.ExpectedMetric { metricName = @"WebTransaction/MVC/Rejit/GetAddNode/{id}", callCount = 1 }, // Unscoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomAddMetricName", callCount = 2 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetAddNode", callCount = 3 }, + new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomAddMetricName", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetAddNode", CallCountAllHarvests = 3 }, // Scoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", metricScope = "WebTransaction/MVC/Home/Index", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomAddMetricName", metricScope = "WebTransaction/Custom/MyCustomAddMetricName", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomAddMetricName", metricScope = "WebTransaction/Custom/MyCustomAddMetricName", CallCountAllHarvests = 2 }, new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetAddNode", metricScope = "WebTransaction/MVC/Rejit/GetAddNode/{id}", callCount = 1 } }; diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitChangeAttributeValue.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitChangeAttributeValue.cs index 3141f66169..82acead2c9 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitChangeAttributeValue.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitChangeAttributeValue.cs @@ -68,7 +68,7 @@ public void Test() new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomChangeMetricName", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomRenamedMetricName", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetChangeAttributeValue", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetChangeAttributeValue", CallCountAllHarvests = 2 }, // Scoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", metricScope = "WebTransaction/MVC/Home/Index", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteAttribute.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteAttribute.cs index dd96165495..f47281106e 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteAttribute.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteAttribute.cs @@ -67,7 +67,7 @@ public void Test() // Unscoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomDeleteMetricName", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetDeleteAttribute", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetDeleteAttribute", CallCountAllHarvests = 2 }, // Scoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", metricScope = "WebTransaction/MVC/Home/Index", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteFile.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteFile.cs index 7739a14177..edbe8965cd 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteFile.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteFile.cs @@ -67,7 +67,7 @@ public void Test() // Unscoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomDeleteMetricName", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetDeleteFile", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetDeleteFile", CallCountAllHarvests = 2 }, // Scoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", metricScope = "WebTransaction/MVC/Home/Index", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteNode.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteNode.cs index 524833f99e..acb2ed3074 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteNode.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitDeleteNode.cs @@ -75,18 +75,18 @@ public void Test() { //transactions new Assertions.ExpectedMetric {metricName = @"WebTransaction/MVC/Home/Index", callCount = 1}, - new Assertions.ExpectedMetric {metricName = @"WebTransaction/Custom/MyCustomDeleteMetricName", callCount = 3}, + new Assertions.ExpectedMetric {metricName = @"WebTransaction/Custom/MyCustomDeleteMetricName", CallCountAllHarvests = 3}, new Assertions.ExpectedMetric {metricName = @"WebTransaction/MVC/Rejit/GetDeleteNode/{id}", callCount = 1}, // Unscoped new Assertions.ExpectedMetric {metricName = @"DotNet/HomeController/Index", callCount = 1}, - new Assertions.ExpectedMetric {metricName = @"Custom/MyCustomDeleteMetricName", callCount = 3}, - new Assertions.ExpectedMetric {metricName = @"DotNet/RejitController/GetDeleteNode", callCount = 4}, + new Assertions.ExpectedMetric {metricName = @"Custom/MyCustomDeleteMetricName", CallCountAllHarvests = 3}, + new Assertions.ExpectedMetric {metricName = @"DotNet/RejitController/GetDeleteNode", CallCountAllHarvests = 4}, // Scoped new Assertions.ExpectedMetric {metricName = @"DotNet/HomeController/Index", metricScope = "WebTransaction/MVC/Home/Index", callCount = 1}, - new Assertions.ExpectedMetric {metricName = @"Custom/MyCustomDeleteMetricName", metricScope = "WebTransaction/Custom/MyCustomDeleteMetricName", callCount = 3}, - new Assertions.ExpectedMetric {metricName = @"DotNet/RejitController/GetDeleteNode", metricScope = "WebTransaction/MVC/Rejit/GetDeleteNode/{id}", callCount = 1} + new Assertions.ExpectedMetric {metricName = @"Custom/MyCustomDeleteMetricName", metricScope = "WebTransaction/Custom/MyCustomDeleteMetricName", CallCountAllHarvests = 3}, + new Assertions.ExpectedMetric {metricName = @"DotNet/RejitController/GetDeleteNode", metricScope = "WebTransaction/MVC/Rejit/GetDeleteNode/{id}", CallCountAllHarvests = 1} }; var metrics = CommonUtils.GetMetrics(_fixture.AgentLog); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitRenameFile.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitRenameFile.cs index 6d7f11b7a8..144e25813d 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitRenameFile.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RejitRenameFile.cs @@ -64,16 +64,16 @@ public void Test() { //transactions new Assertions.ExpectedMetric { metricName = @"WebTransaction/MVC/Home/Index", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomRenameMetricName", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomRenameMetricName", CallCountAllHarvests = 2 }, // Unscoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomRenameMetricName", callCount = 2 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetRenameFile", callCount = 2}, + new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomRenameMetricName", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/RejitController/GetRenameFile", CallCountAllHarvests = 2}, // Scoped new Assertions.ExpectedMetric { metricName = @"DotNet/HomeController/Index", metricScope = "WebTransaction/MVC/Home/Index", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomRenameMetricName", metricScope = "WebTransaction/Custom/MyCustomRenameMetricName", callCount = 2 } + new Assertions.ExpectedMetric { metricName = @"Custom/MyCustomRenameMetricName", metricScope = "WebTransaction/Custom/MyCustomRenameMetricName", CallCountAllHarvests = 2 } }; var notExpectedMetrics = new List diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RemoveIgnoredInstrumentation.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RemoveIgnoredInstrumentation.cs index 7bd2e9cae1..6db39d8c75 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RemoveIgnoredInstrumentation.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetCore/RemoveIgnoredInstrumentation.cs @@ -78,7 +78,7 @@ public void Test() new Assertions.ExpectedMetric { metricName = @"WebTransaction/ASP/Rejit/GetAddNode/0", callCount = 1 }, new Assertions.ExpectedMetric { metricName = @"WebTransaction/ASP/Rejit/GetAddNode/1", callCount = 1 }, // From the second 2 calls to TestAddNode after the instrumentations are enabled - new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomAddMetricName", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomAddMetricName", CallCountAllHarvests = 2 }, // Supportability metric indicating that the managed code successfully parsed the ignored instrumentation settings // This is only sent on the first metric harvest new Assertions.ExpectedMetric { metricName = @"Supportability/Dotnet/IgnoredInstrumentation", callCount = 1 } diff --git a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetFramework/RemoveIgnoredInstrumentation.cs b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetFramework/RemoveIgnoredInstrumentation.cs index 955c0f4b8b..0bca34ce1f 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetFramework/RemoveIgnoredInstrumentation.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/ReJit/NetFramework/RemoveIgnoredInstrumentation.cs @@ -67,7 +67,7 @@ public void Test() var expectedMetrics = new List { // From initialize and first call to TestAddFile while the ignore list is present - new Assertions.ExpectedMetric { metricName = @"WebTransaction/ASP/{controller}/{action}/{id}", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction/ASP/{controller}/{action}/{id}", CallCountAllHarvests = 2 }, // From the call after the ignore list removed new Assertions.ExpectedMetric { metricName = @"WebTransaction/Custom/MyCustomAddMetricName", callCount = 1 }, // Supportability metric indicating that the managed code successfully parsed the ignored instrumentation settings diff --git a/tests/Agent/IntegrationTests/IntegrationTests/RequestHandling/BaseTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/RequestHandling/BaseTests.cs index 49daac6f70..5fb52bc853 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/RequestHandling/BaseTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/RequestHandling/BaseTests.cs @@ -49,7 +49,7 @@ public void Test() NrAssert.Multiple ( - () => Assertions.MetricExists(new Assertions.ExpectedMetric { metricName = expectedTransaction, callCount = 2 }, metrics), + () => Assertions.MetricExists(new Assertions.ExpectedMetric { metricName = expectedTransaction, CallCountAllHarvests = 2 }, metrics), () => Assertions.MetricsDoNotExist(unexpectedTransactions.Select(t => new Assertions.ExpectedMetric { metricName = t }), metrics) ); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationAsyncAwaitCAT.cs b/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationAsyncAwaitCAT.cs index f40cdc7791..e5231875a6 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationAsyncAwaitCAT.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationAsyncAwaitCAT.cs @@ -56,7 +56,7 @@ public void Test() var expectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = "External/all", callCount = 4 }, + new Assertions.ExpectedMetric { metricName = "External/all", CallCountAllHarvests = 4 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/GET", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/PUT", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/POST", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationCAT.cs b/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationCAT.cs index 51397df926..9398ad8a79 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationCAT.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationCAT.cs @@ -58,8 +58,8 @@ public void Test() var serverName = _fixture.DestinationServerName; var expectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = "External/all", callCount = 5 }, - new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/GET", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = "External/all", CallCountAllHarvests = 5 }, + new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/GET", CallCountAllHarvests = 2 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/PUT", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/POST", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/DELETE", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationDistributedTracing.cs b/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationDistributedTracing.cs index 37ad1d03db..28476c423f 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationDistributedTracing.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationDistributedTracing.cs @@ -59,8 +59,8 @@ public void Test() var expectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = "External/all", callCount = 5 }, - new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/GET", callCount = 2 }, + new Assertions.ExpectedMetric { metricName = "External/all", CallCountAllHarvests = 5 }, + new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/GET", CallCountAllHarvests = 2 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/PUT", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/POST", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/DELETE", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationTaskResultCAT.cs b/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationTaskResultCAT.cs index bb72ee83be..a17baec06c 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationTaskResultCAT.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/RestSharp/RestSharpClientInstrumentationTaskResultCAT.cs @@ -56,7 +56,7 @@ public void Test() ; var expectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = "External/all", callCount = 4 }, + new Assertions.ExpectedMetric { metricName = "External/all", CallCountAllHarvests = 4 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/GET", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/PUT", callCount = 1 }, new Assertions.ExpectedMetric { metricName = $"External/{serverName}/Stream/POST", callCount = 1 }, diff --git a/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFClientTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFClientTests.cs index a674612d8a..cc302905d2 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFClientTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFClientTests.cs @@ -42,11 +42,11 @@ public override void Metrics() var expectedMetrics = new List { - new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.Sync_SyncThrowException", callCount = 2 }, - new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.Begin_SyncGetData", callCount = 2 /*Begin/End + Event Based Async*/ }, - new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.Begin_SyncThrowException", callCount = 4 /*Begin/End + Event Based Async*/ }, + new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.Sync_SyncThrowException", CallCountAllHarvests = 2 }, + new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.Begin_SyncGetData", CallCountAllHarvests = 2 /*Begin/End + Event Based Async*/ }, + new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.Begin_SyncThrowException", CallCountAllHarvests = 4 /*Begin/End + Event Based Async*/ }, new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.TAP_SyncGetData" , callCount = 1 }, - new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.TAP_SyncThrowException", callCount = 2 }, + new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.TAP_SyncThrowException", CallCountAllHarvests = 2 }, new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.Sync_SyncGetData", callCount = 1 }, new Assertions.ExpectedMetric(){ metricName = "DotNet/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/ThrowException", From 9084fa726bb3c91a2d3318f86f1c88fe1a1ea7e9 Mon Sep 17 00:00:00 2001 From: chynesNR Date: Mon, 21 Oct 2024 09:52:52 -0700 Subject: [PATCH 2/3] Found more cases --- .../AspNetCoreGenericWebHostTests.cs | 12 ++--- .../AspNetCore/AspNetCoreMvcAsyncTests.cs | 12 ++--- .../AspNetCoreMvcBasicRequestsTests.cs | 12 ++--- .../AspNetCoreMvcFrameworkAsyncTests.cs | 12 ++--- .../BasicInstrumentation/ConsoleAsyncTests.cs | 8 ++-- .../BasicInstrumentation/MvcAsyncTests.cs | 10 ++-- .../BasicInstrumentation/NetCoreAsyncTests.cs | 8 ++-- .../NetStandardLibraryInstrumentation.cs | 4 +- .../ServiceStackApplicationTests.cs | 10 ++-- .../WebApiAsyncForceNewTransactionTests.cs | 24 +++++----- .../BasicInstrumentation/WebApiAsyncTests.cs | 10 ++-- ...synConsoleAsyncForceNewTransactionTests.cs | 16 +++---- .../InfiniteTracing/InfiniteTracingTests.cs | 6 +-- .../IntegrationTests/WCF/WCFClientTests.cs | 36 +++++++-------- .../IntegrationTests/WCF/WCFServiceTests.cs | 46 +++++++++---------- 15 files changed, 113 insertions(+), 113 deletions(-) diff --git a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreGenericWebHostTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreGenericWebHostTests.cs index 009618777a..e0e42f9e52 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreGenericWebHostTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreGenericWebHostTests.cs @@ -96,15 +96,15 @@ public void Test() private readonly List _generalMetrics = new List { new Assertions.ExpectedMetric { metricName = @"Supportability/OS/Linux", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"Apdex"}, new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", callCount = ExpectedTransactionCount } + new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", CallCountAllHarvests = ExpectedTransactionCount } }; private readonly List _indexMetrics = new List diff --git a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcAsyncTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcAsyncTests.cs index 61b5a0ead3..ebc1a60add 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcAsyncTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcAsyncTests.cs @@ -97,15 +97,15 @@ public void Test() private readonly List _generalMetrics = new List { new Assertions.ExpectedMetric { metricName = @"Supportability/OS/Linux", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"Apdex"}, new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", callCount = ExpectedTransactionCount } + new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", CallCountAllHarvests = ExpectedTransactionCount } }; private readonly List _ioBoundNoSpecialAsyncMetrics = new List { diff --git a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcBasicRequestsTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcBasicRequestsTests.cs index cf5b16a3a9..f8f10308f6 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcBasicRequestsTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcBasicRequestsTests.cs @@ -106,15 +106,15 @@ public void Test() private readonly List _generalMetrics = new List { new Assertions.ExpectedMetric { metricName = @"Supportability/OS/Linux", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"Apdex"}, new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", callCount = ExpectedTransactionCount } + new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", CallCountAllHarvests = ExpectedTransactionCount } }; private readonly List _indexMetrics = new List diff --git a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcFrameworkAsyncTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcFrameworkAsyncTests.cs index 9e661cb32f..9a815cb78d 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcFrameworkAsyncTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/AspNetCore/AspNetCoreMvcFrameworkAsyncTests.cs @@ -90,15 +90,15 @@ public void Test() private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"Apdex"}, new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", callCount = ExpectedTransactionCount } + new Assertions.ExpectedMetric { metricName = @"DotNet/Middleware Pipeline", CallCountAllHarvests = ExpectedTransactionCount } }; private readonly List _ioBoundNoSpecialAsyncMetrics = new List { diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ConsoleAsyncTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ConsoleAsyncTests.cs index 13ba69bf23..835daa3306 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ConsoleAsyncTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ConsoleAsyncTests.cs @@ -102,10 +102,10 @@ public void Test() private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, }; private readonly List _ioBoundNoSpecialAsyncMetrics = new List { diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/MvcAsyncTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/MvcAsyncTests.cs index a80e6ce758..3f2c9b5590 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/MvcAsyncTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/MvcAsyncTests.cs @@ -100,13 +100,13 @@ public void Test() private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"Apdex"}, new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, }; private readonly List _ioBoundNoSpecialAsyncMetrics = new List { diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/NetCoreAsyncTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/NetCoreAsyncTests.cs index 93960fe139..2cad4d495e 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/NetCoreAsyncTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/NetCoreAsyncTests.cs @@ -70,10 +70,10 @@ public void Test() private readonly List _generalMetrics = new List { new Assertions.ExpectedMetric { metricName = @"Supportability/OS/Linux", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, }; private readonly List _ioBoundNoSpecialAsyncMetrics = new List { diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/NetStandardLibraryInstrumentation.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/NetStandardLibraryInstrumentation.cs index eb48fe5309..249d10e787 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/NetStandardLibraryInstrumentation.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/NetStandardLibraryInstrumentation.cs @@ -88,8 +88,8 @@ public void Test() { var expectedMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"OtherTransaction/Custom/NetStandardTestLibrary.NetStandardTestLibUtil/Test", callCount = 1 }, - new Assertions.ExpectedMetric { metricName = @"DotNet/NetStandardTestLibrary.NetStandardTestLibUtil/Test", callCount = COUNT_ITERATIONS + 1 }, + new Assertions.ExpectedMetric { metricName = @"OtherTransaction/Custom/NetStandardTestLibrary.NetStandardTestLibUtil/Test", CallCountAllHarvests = 1 }, + new Assertions.ExpectedMetric { metricName = @"DotNet/NetStandardTestLibrary.NetStandardTestLibUtil/Test", CallCountAllHarvests = COUNT_ITERATIONS + 1 }, }; var actualMetrics = _fixture.AgentLog.GetMetrics().ToList(); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ServiceStackApplicationTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ServiceStackApplicationTests.cs index 20665817ea..1c3ac88c2c 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ServiceStackApplicationTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/ServiceStackApplicationTests.cs @@ -66,13 +66,13 @@ public void ShouldNotStackOverflowWithSerializingLogger() private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"Apdex"}, new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, }; private readonly List _pipelineMetrics = new List diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/WebApiAsyncForceNewTransactionTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/WebApiAsyncForceNewTransactionTests.cs index 730a79e7d1..52296beecc 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/WebApiAsyncForceNewTransactionTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/WebApiAsyncForceNewTransactionTests.cs @@ -58,15 +58,15 @@ public void Test() private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount}, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount}, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"Apdex"}, new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = ExpectedWebTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = ExpectedWebTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedWebTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", callCount = ExpectedOtherTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", callCount = ExpectedOtherTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedWebTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedWebTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedWebTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", CallCountAllHarvests = ExpectedOtherTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", CallCountAllHarvests = ExpectedOtherTransactionCount }, }; private readonly List _expectedMetrics_Async_AwaitedAsync = new List @@ -128,13 +128,13 @@ protected override void SetupConfiguration(string instrumentationFilePath) private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount}, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount}, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"Apdex"}, new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = ExpectedWebTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = ExpectedWebTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedWebTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedWebTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedWebTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedWebTransactionCount }, }; private readonly List _expectedMetrics_Async_AwaitedAsync = new List diff --git a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/WebApiAsyncTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/WebApiAsyncTests.cs index 0a8f24f306..76fd6f5f4b 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/WebApiAsyncTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/BasicInstrumentation/WebApiAsyncTests.cs @@ -108,13 +108,13 @@ public void Test() private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, new Assertions.ExpectedMetric { metricName = @"Apdex"}, new Assertions.ExpectedMetric { metricName = @"ApdexAll"}, - new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransaction", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"HttpDispatcher", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransaction", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"WebTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, }; private readonly List _ioBoundNoSpecialAsyncMetrics = new List { diff --git a/tests/Agent/IntegrationTests/IntegrationTests/CustomInstrumentation/ConsoleAsynConsoleAsyncForceNewTransactionTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/CustomInstrumentation/ConsoleAsynConsoleAsyncForceNewTransactionTests.cs index 61ca12e544..5111f60baf 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/CustomInstrumentation/ConsoleAsynConsoleAsyncForceNewTransactionTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/CustomInstrumentation/ConsoleAsynConsoleAsyncForceNewTransactionTests.cs @@ -59,10 +59,10 @@ public void Test() private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount}, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount}, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, }; private readonly List _expectedMetrics_Async_AwaitedAsync = new List @@ -149,10 +149,10 @@ public void Test() private readonly List _generalMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", callCount = ExpectedTransactionCount}, - new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", callCount = ExpectedTransactionCount }, - new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", callCount = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsSeen", CallCountAllHarvests = ExpectedTransactionCount}, + new Assertions.ExpectedMetric { metricName = @"Supportability/AnalyticsEvents/TotalEventsCollected", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all", CallCountAllHarvests = ExpectedTransactionCount }, + new Assertions.ExpectedMetric { metricName = @"OtherTransactionTotalTime", CallCountAllHarvests = ExpectedTransactionCount }, }; private readonly List _expectedMetrics_Async_AwaitedAsync = new List diff --git a/tests/Agent/IntegrationTests/IntegrationTests/InfiniteTracing/InfiniteTracingTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/InfiniteTracing/InfiniteTracingTests.cs index 850ee982da..c60d61bc9c 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/InfiniteTracing/InfiniteTracingTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/InfiniteTracing/InfiniteTracingTests.cs @@ -1,4 +1,4 @@ -// Copyright 2020 New Relic, Inc. All rights reserved. +// Copyright 2020 New Relic, Inc. All rights reserved. // SPDX-License-Identifier: Apache-2.0 using System; @@ -57,8 +57,8 @@ public void Test() var actualMetrics = new List { - new Assertions.ExpectedMetric { metricName = @"Supportability/InfiniteTracing/Span/Seen", callCount = expectedSeenCount }, - new Assertions.ExpectedMetric { metricName = @"Supportability/InfiniteTracing/Span/Sent", callCount = ExpectedSentCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/InfiniteTracing/Span/Seen", CallCountAllHarvests = expectedSeenCount }, + new Assertions.ExpectedMetric { metricName = @"Supportability/InfiniteTracing/Span/Sent", CallCountAllHarvests = ExpectedSentCount }, }; var metrics = _fixture.AgentLog.GetMetrics(); diff --git a/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFClientTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFClientTests.cs index cc302905d2..96c7cda0cb 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFClientTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFClientTests.cs @@ -50,13 +50,13 @@ public override void Metrics() new Assertions.ExpectedMetric(){ metricName = $"External/{serverName}/Stream/{SharedWcfLibraryNamespace}.IWcfClient.Sync_SyncGetData", callCount = 1 }, new Assertions.ExpectedMetric(){ metricName = "DotNet/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/ThrowException", - metricScope = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/ThrowException", callCount = _countClientInvocationMethodsToTest * 2 }, + metricScope = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/ThrowException", CallCountAllHarvests = _countClientInvocationMethodsToTest * 2 }, new Assertions.ExpectedMetric(){ metricName = "DotNet/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/GetData", - metricScope = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/GetData", callCount = _countClientInvocationMethodsToTest }, - new Assertions.ExpectedMetric(){ metricName = "DotNet/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/GetData", callCount = _countClientInvocationMethodsToTest }, + metricScope = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/GetData", CallCountAllHarvests = _countClientInvocationMethodsToTest }, + new Assertions.ExpectedMetric(){ metricName = "DotNet/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/GetData", CallCountAllHarvests = _countClientInvocationMethodsToTest }, - new Assertions.ExpectedMetric(){ metricName = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/ThrowException", callCount = _countClientInvocationMethodsToTest * 2 }, - new Assertions.ExpectedMetric(){ metricName = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/GetData", callCount = _countClientInvocationMethodsToTest }, + new Assertions.ExpectedMetric(){ metricName = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/ThrowException", CallCountAllHarvests = _countClientInvocationMethodsToTest * 2 }, + new Assertions.ExpectedMetric(){ metricName = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/GetData", CallCountAllHarvests = _countClientInvocationMethodsToTest }, }; var catExcludedMetrics = new[] @@ -110,18 +110,18 @@ public override void DistributedTracing_Metrics() { // generated by client new Assertions.ExpectedMetric(){ metricName = "DurationByCaller/Unknown/Unknown/Unknown/Unknown/all", - callCount = _expectedTransactionCount_Client + CallCountAllHarvests = _expectedTransactionCount_Client }, // generated by service new Assertions.ExpectedMetric(){ metricName = $"DurationByCaller/App/{acctId}/{appId}/{ExpectedTransportType}/all", - callCount = _expectedTransactionCount_Client + CallCountAllHarvests = _expectedTransactionCount_Client }, new Assertions.ExpectedMetric(){ metricName = "Supportability/DistributedTrace/CreatePayload/Success", - callCount = (_expectedTransactionCount_Client) //Each Client Call + CallCountAllHarvests = (_expectedTransactionCount_Client) //Each Client Call + (_countClientInvocationMethodsToTest) //Covering the HTTP call in GetData in the service }, new Assertions.ExpectedMetric(){ metricName = "Supportability/TraceContext/Create/Success", - callCount = (_expectedTransactionCount_Client) //Each Client Call + CallCountAllHarvests = (_expectedTransactionCount_Client) //Each Client Call + (_countClientInvocationMethodsToTest) //Covering the HTTP call in GetData in the service } }; @@ -144,18 +144,18 @@ public override void CAT_Metrics() var expectedMetrics = new List { - new Assertions.ExpectedMetric(){ callCount = _countClientInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"ExternalApp/{serverName}/{CATCrossProcessID_Service}/all" }, - new Assertions.ExpectedMetric(){ callCount = _countClientInvocationMethodsToTest, metricName = $"ExternalTransaction/{serverName}/{CATCrossProcessID_Service}/WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncGetData"}, - new Assertions.ExpectedMetric(){ callCount = _countClientInvocationMethodsToTest, metricName = $"ExternalTransaction/{serverName}/{CATCrossProcessID_Service}/WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncGetData", + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countClientInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"ExternalApp/{serverName}/{CATCrossProcessID_Service}/all" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countClientInvocationMethodsToTest, metricName = $"ExternalTransaction/{serverName}/{CATCrossProcessID_Service}/WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncGetData"}, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countClientInvocationMethodsToTest, metricName = $"ExternalTransaction/{serverName}/{CATCrossProcessID_Service}/WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncGetData", metricScope = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/GetData"}, - new Assertions.ExpectedMetric(){ callCount = _countClientInvocationMethodsToTest * 2, metricName = $"ExternalTransaction/{serverName}/{CATCrossProcessID_Service}/WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException"}, - new Assertions.ExpectedMetric(){ callCount = _countClientInvocationMethodsToTest * 2, metricName = $"ExternalTransaction/{serverName}/{CATCrossProcessID_Service}/WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException", + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countClientInvocationMethodsToTest * 2, metricName = $"ExternalTransaction/{serverName}/{CATCrossProcessID_Service}/WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException"}, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countClientInvocationMethodsToTest * 2, metricName = $"ExternalTransaction/{serverName}/{CATCrossProcessID_Service}/WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException", metricScope = "OtherTransaction/Custom/ConsoleMultiFunctionApplicationFW.NetFrameworkLibraries.WCF.WCFClient/ThrowException"}, - new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Request/Create/Success" , callCount = countExpectedCreate },//16 - new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Request/Accept/Success", callCount = countExpectedAccept}, //24 - new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Response/Create/Success", callCount = countExpectedResponse }, - new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Response/Accept/Success", callCount = _countClientInvocationMethodsToTest * COUNT_SVC_METHODS }, + new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Request/Create/Success" , CallCountAllHarvests = countExpectedCreate },//16 + new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Request/Accept/Success", CallCountAllHarvests = countExpectedAccept}, //24 + new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Response/Create/Success", CallCountAllHarvests = countExpectedResponse }, + new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Response/Accept/Success", CallCountAllHarvests = _countClientInvocationMethodsToTest * COUNT_SVC_METHODS }, }; var unexpectedMetrics = new List diff --git a/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFServiceTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFServiceTests.cs index 6e88097956..c5c2ef9389 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFServiceTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/WCF/WCFServiceTests.cs @@ -144,14 +144,14 @@ public override void Metrics() var expectedMetrics = new List { - new Assertions.ExpectedMetric(){ callCount = expectedTrxCount, metricName = "WebTransaction" }, - new Assertions.ExpectedMetric(){ callCount = _countServiceInvocationMethodsToTest * 2, metricName="Supportability/Events/TransactionError/Seen"}, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = expectedTrxCount, metricName = "WebTransaction" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countServiceInvocationMethodsToTest * 2, metricName="Supportability/Events/TransactionError/Seen"}, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncGetData" }, - new Assertions.ExpectedMetric(){ callCount =2, metricName = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests =2, metricName = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.SyncGetData" }, - new Assertions.ExpectedMetric(){ callCount =2, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests =2, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.BeginAsyncGetData" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.BeginAsyncThrowExceptionAtStart" }, @@ -165,19 +165,19 @@ public override void Metrics() new Assertions.ExpectedMetric(){ callCount =1, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.EndAsyncThrowExceptionAtEnd" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.TAPGetData" }, - new Assertions.ExpectedMetric(){ callCount =2, metricName = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.TAPThrowException" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests =2, metricName = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.TAPThrowException" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.TAPGetData" }, - new Assertions.ExpectedMetric(){ callCount =2, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.TAPThrowException" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests =2, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.TAPThrowException" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.TAPGetData", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.TAPGetData" }, - new Assertions.ExpectedMetric(){ callCount =2, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.TAPThrowException", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.TAPThrowException" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests =2, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.TAPThrowException", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.TAPThrowException" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.SyncGetData", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncGetData" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.BeginAsyncGetData", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.BeginAsyncGetData" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.EndAsyncGetData", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.BeginAsyncGetData" }, - new Assertions.ExpectedMetric(){ callCount =2, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests =2, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.SyncThrowException" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.BeginAsyncThrowExceptionAtStart", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.BeginAsyncThrowExceptionAtStart" }, new Assertions.ExpectedMetric(){ callCount =1, metricName = $"DotNet/{SharedWcfLibraryNamespace}.IWcfService.BeginAsyncThrowExceptionAtEnd", metricScope = $"WebTransaction/WCF/{SharedWcfLibraryNamespace}.IWcfService.BeginAsyncThrowExceptionAtEnd" }, @@ -220,26 +220,26 @@ public override void DistributedTracing_Metrics() var expectedMetrics = new List { - new Assertions.ExpectedMetric(){ callCount = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"DurationByCaller/App/{AccountID_Client}/{AppID_Client}/{ExpectedTransportType}/all" }, - new Assertions.ExpectedMetric(){ callCount = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"DurationByCaller/App/{AccountID_Client}/{AppID_Client}/{ExpectedTransportType}/allWeb" }, - new Assertions.ExpectedMetric(){ callCount = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"TransportDuration/App/{AccountID_Client}/{AppID_Client}/{ExpectedTransportType}/all" }, - new Assertions.ExpectedMetric(){ callCount = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"TransportDuration/App/{AccountID_Client}/{AppID_Client}/{ExpectedTransportType}/allWeb" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"DurationByCaller/App/{AccountID_Client}/{AppID_Client}/{ExpectedTransportType}/all" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"DurationByCaller/App/{AccountID_Client}/{AppID_Client}/{ExpectedTransportType}/allWeb" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"TransportDuration/App/{AccountID_Client}/{AppID_Client}/{ExpectedTransportType}/all" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"TransportDuration/App/{AccountID_Client}/{AppID_Client}/{ExpectedTransportType}/allWeb" }, new Assertions.ExpectedMetric(){ metricName = "Supportability/DistributedTrace/CreatePayload/Success", - callCount = (_countServiceInvocationMethodsToTest * COUNT_SVC_METHODS) //Each Client Call + CallCountAllHarvests = (_countServiceInvocationMethodsToTest * COUNT_SVC_METHODS) //Each Client Call + _countServiceInvocationMethodsToTest //Covering the HTTP call in GetData + 1 //Covering the HTTP call in AsyncThrowExceptionAtEnd (it call DoWork which does an HTTP Request) }, new Assertions.ExpectedMetric(){ metricName = "Supportability/TraceContext/Create/Success", - callCount = (_countServiceInvocationMethodsToTest * COUNT_SVC_METHODS) //Each Client Call + CallCountAllHarvests = (_countServiceInvocationMethodsToTest * COUNT_SVC_METHODS) //Each Client Call + _countServiceInvocationMethodsToTest //Covering the HTTP call in GetData + 1 //Covering the HTTP call in AsyncThrowExceptionAtEnd (it call DoWork which does an HTTP Request) }, //In IIS Hosted Scenarios with ASPCompatibility Disabled, the ignore transaction wrapper is used on the ASP.Pipeline hit. //However, before this occurs, an accept has occurred, which doubles the number of accepts. new Assertions.ExpectedMetric(){ metricName = "Supportability/TraceContext/Accept/Success", - callCount = _hostingModelOption == HostingModel.Self || _aspCompatibilityOption == ASPCompatibilityMode.Enabled + CallCountAllHarvests = _hostingModelOption == HostingModel.Self || _aspCompatibilityOption == ASPCompatibilityMode.Enabled ? _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS : _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS * 2 }, @@ -269,12 +269,12 @@ public override void CAT_Metrics() var expectedMetrics = new List { - new Assertions.ExpectedMetric(){ callCount = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"ClientApplication/{CATCrossProcessID_Client}/all" }, + new Assertions.ExpectedMetric(){ CallCountAllHarvests = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS, metricName = $"ClientApplication/{CATCrossProcessID_Client}/all" }, - new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Request/Create/Success" , callCount = countExpectedCreate }, - new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Request/Accept/Success", callCount = countExpectedAccept}, - new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Response/Create/Success", callCount = countExpectedResponse }, - new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Response/Accept/Success", callCount = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS }, + new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Request/Create/Success" , CallCountAllHarvests = countExpectedCreate }, + new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Request/Accept/Success", CallCountAllHarvests = countExpectedAccept}, + new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Response/Create/Success", CallCountAllHarvests = countExpectedResponse }, + new Assertions.ExpectedMetric(){ metricName = "Supportability/CrossApplicationTracing/Response/Accept/Success", CallCountAllHarvests = _countServiceInvocationMethodsToTest * COUNT_SVC_METHODS }, }; var unexpectedMetrics = new List @@ -365,11 +365,11 @@ public override void DistributedTracing_SpanEvents() // In debug we consistently get 10 extra ASP pipeline events, in Release we consistently get 9. // We do not see spans for 'PreExecuteRequestHandler' in Release, but we do in Debug. - #if DEBUG +#if DEBUG const int COUNT_ASP_PIPELINE_EVENTS = 10; - #else +#else const int COUNT_ASP_PIPELINE_EVENTS = 9; - #endif +#endif foreach (var svcTrxName in svcTrxNames) { From ed8f8dda4a5ddc852efe33a5d7b210cacbc3c8c7 Mon Sep 17 00:00:00 2001 From: chynesNR Date: Mon, 21 Oct 2024 12:58:43 -0700 Subject: [PATCH 3/3] Fixed bug in TryFindMetrics() --- .../Agent/IntegrationTests/IntegrationTestHelpers/Assertions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Agent/IntegrationTests/IntegrationTestHelpers/Assertions.cs b/tests/Agent/IntegrationTests/IntegrationTestHelpers/Assertions.cs index 7889b41a73..fa8c5d6fde 100644 --- a/tests/Agent/IntegrationTests/IntegrationTestHelpers/Assertions.cs +++ b/tests/Agent/IntegrationTests/IntegrationTestHelpers/Assertions.cs @@ -591,7 +591,7 @@ public static List TryFindMetrics(ExpectedMetric expectedMetric, IEnumer var foundMetrics = actualMetrics .Where(actualMetric => (expectedMetric.IsRegexName && Regex.IsMatch(actualMetric.MetricSpec.Name, expectedMetric.metricName)) || (!expectedMetric.IsRegexName && expectedMetric.metricName == actualMetric.MetricSpec.Name)) - .Where(actualMetric => (expectedMetric.IsRegexScope && Regex.IsMatch(actualMetric.MetricSpec.Scope, expectedMetric.metricScope)) || + .Where(actualMetric => (expectedMetric.IsRegexScope && Regex.IsMatch(actualMetric.MetricSpec.Scope ?? string.Empty, expectedMetric.metricScope)) || (!expectedMetric.IsRegexScope && expectedMetric.metricScope == actualMetric.MetricSpec.Scope)) .ToList();