From b6db8bc46e8e3a6ed6920a64736971f0e234437f Mon Sep 17 00:00:00 2001 From: Long Date: Tue, 8 Aug 2023 14:38:14 +0100 Subject: [PATCH] rename --- src/Activities/Internal/EventSource/ActivityEventSender.cs | 2 +- src/Activities/Option/ActivityOption.cs | 2 +- .../Activities.UnitTests/Internal/ActivitiesEventSourceTests.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Activities/Internal/EventSource/ActivityEventSender.cs b/src/Activities/Internal/EventSource/ActivityEventSender.cs index f1b0becf..ad7806bc 100644 --- a/src/Activities/Internal/EventSource/ActivityEventSender.cs +++ b/src/Activities/Internal/EventSource/ActivityEventSender.cs @@ -27,7 +27,7 @@ public ActivityEventSender(ActivityEventSource eventSource, IExecutionContext ex public void SendActivityMetric(Activity activity) { - if (m_options.Value.DisableActivityEventSender || !m_eventSource.IsEnabled()) + if (!m_options.Value.ActivityEventSenderEnabled || !m_eventSource.IsEnabled()) { return; } diff --git a/src/Activities/Option/ActivityOption.cs b/src/Activities/Option/ActivityOption.cs index e3488ecc..49f5679e 100644 --- a/src/Activities/Option/ActivityOption.cs +++ b/src/Activities/Option/ActivityOption.cs @@ -16,6 +16,6 @@ public class ActivityOption /// /// Disable ActivityEventSender so Activity metric is only sent via ActivityMetricsSender /// - public bool DisableActivityEventSender { get; set; } + public bool ActivityEventSenderEnabled { get; set; } = true; } } diff --git a/tests/Activities.UnitTests/Internal/ActivitiesEventSourceTests.cs b/tests/Activities.UnitTests/Internal/ActivitiesEventSourceTests.cs index 06c2b3cf..4ae39223 100644 --- a/tests/Activities.UnitTests/Internal/ActivitiesEventSourceTests.cs +++ b/tests/Activities.UnitTests/Internal/ActivitiesEventSourceTests.cs @@ -80,7 +80,7 @@ public void LogActivityEndEvent_DisableByOption_CreatesNoEvent(EventSourcesEvent contextMock.Setup(c => c.ServiceName).Returns("TestService"); Mock> mockOptions = new(); - ActivityOption activityOption = new() { DisableActivityEventSender = true }; + ActivityOption activityOption = new() { ActivityEventSenderEnabled = false }; mockOptions.Setup(m => m.Value).Returns(activityOption); ActivityEventSender logEventSource = new(