Table of Contents

Class ProfilingSession

Namespace
DotCompute.Backends.OpenCL.Profiling
Assembly
DotCompute.Backends.OpenCL.dll

Represents a profiling session that collects and aggregates profiled events.

public sealed class ProfilingSession
Inheritance
ProfilingSession
Inherited Members

Remarks

A profiling session is a logical grouping of profiled events that occur during a specific time period or workflow. Sessions can be used to profile:

  • Entire application runs
  • Specific algorithm executions
  • Batch processing operations
  • Performance regression testing

Sessions are thread-safe and support concurrent event recording.

Properties

EndTime

Gets the end time of the profiling session (UTC). Null if the session has not been finalized.

public DateTime? EndTime { get; }

Property Value

DateTime?

Events

Gets the collection of profiled events recorded in this session.

public IReadOnlyCollection<ProfiledEvent> Events { get; }

Property Value

IReadOnlyCollection<ProfiledEvent>

IsFinalized

Gets whether the session has been finalized.

public bool IsFinalized { get; }

Property Value

bool

Name

Gets the descriptive name of the profiling session.

public string Name { get; }

Property Value

string

SessionId

Gets the unique identifier for this profiling session.

public Guid SessionId { get; }

Property Value

Guid

StartTime

Gets the start time of the profiling session (UTC).

public DateTime StartTime { get; }

Property Value

DateTime

Methods

Complete()

Completes the session, setting the end time and preventing further event recording.

public void Complete()

Exceptions

InvalidOperationException

Thrown if session is already finalized.

GetStatistics()

Gets comprehensive statistics for all events in this session. Results are cached after first calculation until new events are recorded.

public ProfilingStatistics GetStatistics()

Returns

ProfilingStatistics

Aggregated statistics for the session.

RecordEvent(ProfiledEvent)

Records a profiled event to this session.

public void RecordEvent(ProfiledEvent evt)

Parameters

evt ProfiledEvent

The profiled event to record.

Exceptions

ArgumentNullException

Thrown if evt is null.

InvalidOperationException

Thrown if session is already finalized.

ToString()

Returns a string representation of this profiling session.

public override string ToString()

Returns

string