Class DefaultFeatureUsageTrackingSession
- Namespace
- Splat.ApplicationPerformanceMonitoring
- Assembly
- Splat.dll
Provides a default implementation of a feature usage tracking session, enabling tracking and logging of feature usage events within an application.
public sealed class DefaultFeatureUsageTrackingSession : IFeatureUsageTrackingSession<Guid>, IFeatureUsageTrackingSession, IDisposable, IEnableLogger
- Inheritance
-
DefaultFeatureUsageTrackingSession
- Implements
-
IEnableLogger
- Extension Methods
Remarks
This class creates a new tracking session for a specified feature and supports hierarchical tracking by allowing sub-feature sessions. It logs session start, exceptions, and session completion events for diagnostic purposes. Instances are intended to be disposed when tracking is complete to ensure proper logging of session end.
Constructors
DefaultFeatureUsageTrackingSession(string)
Initializes a new instance of the DefaultFeatureUsageTrackingSession class.
public DefaultFeatureUsageTrackingSession(string featureName)
Parameters
featureNamestringThe name of the feature.
Properties
FeatureName
Gets the name of the Feature being tracked.
public string FeatureName { get; }
Property Value
FeatureReference
Gets the current Feature Usage Unique Reference.
public Guid FeatureReference { get; }
Property Value
ParentReference
Gets the unique reference for the Parent Tracking Session, if any.
public Guid ParentReference { get; }
Property Value
Methods
Dispose()
public void Dispose()
OnException(Exception)
Notify the APM toolset an exception has occurred in the current tracking session.
public void OnException(Exception exception)
Parameters
exceptionExceptionThe exception that occurred.
SubFeature(string)
Creates a new sub-feature tracking session with the specified description.
public IFeatureUsageTrackingSession SubFeature(string description)
Parameters
descriptionstringA string that describes the sub-feature to be tracked. Cannot be null or empty.
Returns
- IFeatureUsageTrackingSession
An IFeatureUsageTrackingSession instance for tracking usage of the specified sub-feature.
Remarks
Use sub-feature tracking sessions to record usage metrics for distinct operations or components within a larger feature. Each sub-feature session is independent and should be disposed when tracking is complete.