Skip to content
This repository was archived by the owner on Jul 5, 2020. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ public class RequestTrackingTelemetryModule : ITelemetryModule
private TelemetryConfiguration telemetryConfiguration;
private bool initializationErrorReported;
private ChildRequestTrackingSuppressionModule childRequestTrackingSuppressionModule = null;

/// <summary>
/// Handler types that are not TransferHandlers will be included in request tracking.
/// </summary>
private HashSet<Type> requestHandlerTypesDoNotFilter = new HashSet<Type>();

/// <summary>Tracks if given type should be included in telemetry. ConcurrentDictionary is used as a concurrent hashset.</summary>
private ConcurrentDictionary<Type, bool> includedHttpHandlerTypes = new ConcurrentDictionary<Type, bool>();

/// <summary>
/// Gets or sets a value indicating whether child request suppression is enabled or disabled.
Expand Down Expand Up @@ -371,7 +369,7 @@ private bool IsHandlerToFilter(IHttpHandler handler)
if (handler != null)
{
var handlerType = handler.GetType();
if (!this.requestHandlerTypesDoNotFilter.Contains(handlerType))
if (!this.includedHttpHandlerTypes.ContainsKey(handlerType))
{
var handlerName = handlerType.FullName;
foreach (var h in this.Handlers)
Expand All @@ -383,7 +381,7 @@ private bool IsHandlerToFilter(IHttpHandler handler)
}
}

this.requestHandlerTypesDoNotFilter.Add(handlerType);
this.includedHttpHandlerTypes.TryAdd(handlerType, true);
}
}

Expand Down