-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Diagnostics.Tracing
Milestone
Description
Motivation
It is motivated as a performance optimization. The IsEnabled() with no arguments allow a inlinable quick check for performance reasons.
Details
Add DiagnoticListener.IsEnabled() without arguments as an initial loose check that returns true if there is a subscriber to DiagnosticListener (suggested in dotnet/corefx#15971).
API proposal
public bool IsEnabled() {return _subscriptions != null;};/cc @vancem @stephentoub
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Diagnostics.Tracing