1 instantiation of HttpMetricsEnrichmentContext
System.Net.Http (1)
System\Net\Http\Metrics\HttpMetricsEnrichmentContext.cs (1)
93context = new HttpMetricsEnrichmentContext();
14 references to HttpMetricsEnrichmentContext
System.Net.Http (14)
System\Net\Http\Metrics\HttpMetricsEnrichmentContext.cs (12)
17/// Enrichment is done on per-request basis by callbacks registered with <see cref="AddCallback(HttpRequestMessage, Action{HttpMetricsEnrichmentContext})"/>. 19/// information exposed on the <see cref="HttpMetricsEnrichmentContext"/> instance. 22/// > The <see cref="HttpMetricsEnrichmentContext"/> intance must not be used from outside of the enrichment callbacks. 26private static readonly HttpRequestOptionsKey<HttpMetricsEnrichmentContext> s_optionsKeyForContext = new(nameof(HttpMetricsEnrichmentContext)); 27private static readonly ConcurrentQueue<HttpMetricsEnrichmentContext> s_pool = new(); 31private readonly List<Action<HttpMetricsEnrichmentContext>> _callbacks = new(); 78public static void AddCallback(HttpRequestMessage request, Action<HttpMetricsEnrichmentContext> callback) 84if (!options.TryGetValue(s_optionsKeyForContext, out HttpMetricsEnrichmentContext? context)) 101internal static HttpMetricsEnrichmentContext? GetEnrichmentContextForRequest(HttpRequestMessage request) 107request._options.TryGetValue(s_optionsKeyForContext, out HttpMetricsEnrichmentContext? context); 135foreach (Action<HttpMetricsEnrichmentContext> callback in _callbacks)
System\Net\Http\Metrics\MetricsHandler.cs (2)
124HttpMetricsEnrichmentContext? enrichmentContext = HttpMetricsEnrichmentContext.GetEnrichmentContextForRequest(request);