Skip to content

Commit

Permalink
remove unused code (Azure#37470)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyMothra authored and pull[bot] committed Aug 9, 2024
1 parent 80182c8 commit 3e01884
Showing 1 changed file with 0 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using Azure.Monitor.OpenTelemetry.Exporter.Internals.Diagnostics;
using Azure.Monitor.OpenTelemetry.Exporter.Tests.CommonTestFramework;
using Xunit;
Expand All @@ -24,48 +21,5 @@ public void EventSourceTest_AzureMonitorExporterEventSource()
{
EventSourceTestHelper.MethodsAreImplementedConsistentlyWithTheirAttributes(AzureMonitorExporterEventSource.Log);
}

public class TestListener : EventListener
{
private readonly List<EventSource> eventSources = new();
private readonly Guid guid = Guid.NewGuid();

public List<EventWrittenEventArgs> Events = new();

public TestListener()
{
EventSource.SetCurrentThreadActivityId(guid);
}

public override void Dispose()
{
foreach (EventSource eventSource in this.eventSources)
{
this.DisableEvents(eventSource);
}

base.Dispose();
GC.SuppressFinalize(this);
}

protected override void OnEventSourceCreated(EventSource eventSource)
{
if (eventSource.Name == AzureMonitorExporterEventSource.EventSourceName)
{
this.eventSources.Add(eventSource);
this.EnableEvents(eventSource, EventLevel.Verbose, EventKeywords.All);
}

base.OnEventSourceCreated(eventSource);
}

protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
if (eventData.ActivityId == this.guid)
{
this.Events.Add(eventData);
}
}
}
}
}

0 comments on commit 3e01884

Please sign in to comment.