Table of Contents

Class AppCenterFeatureUsageTrackingSession

Namespace
Splat
Assembly
Splat.AppCenter.dll

Represents a feature usage tracking session that reports usage events and exceptions to App Center Analytics and Crashes.

public sealed class AppCenterFeatureUsageTrackingSession : IFeatureUsageTrackingSession<Guid>, IFeatureUsageTrackingSession, IDisposable
Inheritance
AppCenterFeatureUsageTrackingSession
Implements
Extension Methods

Remarks

This class is used to track the start and end of a feature usage session, as well as any exceptions that occur during the session. It generates unique references for each session and supports hierarchical tracking of sub-features. All tracking data is sent to Microsoft App Center services. Instances of this class are not thread-safe.

Constructors

AppCenterFeatureUsageTrackingSession(string)

Initializes a new instance of the AppCenterFeatureUsageTrackingSession class.

public AppCenterFeatureUsageTrackingSession(string featureName)

Parameters

featureName string

The name of the feature.

Properties

FeatureName

Gets the name of the Feature being tracked.

public string FeatureName { get; }

Property Value

string

FeatureReference

Gets the current Feature Usage Unique Reference.

public Guid FeatureReference { get; }

Property Value

Guid

ParentReference

Gets the unique reference for the Parent Tracking Session, if any.

public Guid ParentReference { get; }

Property Value

Guid

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

exception Exception

The exception that occurred.

SubFeature(string)

Creates a new sub-feature tracking session with the specified description.

public IFeatureUsageTrackingSession SubFeature(string description)

Parameters

description string

A 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.