Table of Contents

Class ProfileReport

Namespace
AiDotNet.Diagnostics
Assembly
AiDotNet.dll

A comprehensive profiling report containing all collected metrics.

public class ProfileReport
Inheritance
ProfileReport
Inherited Members

Properties

Entries

Gets the profiled entries.

public IReadOnlyList<IProfilerEntry> Entries { get; }

Property Value

IReadOnlyList<IProfilerEntry>

StartTime

Gets the start time of the profiling session.

public DateTime StartTime { get; }

Property Value

DateTime

Stats

Gets a dictionary of operation name to statistics.

public IReadOnlyDictionary<string, ProfilerStats> Stats { get; }

Property Value

IReadOnlyDictionary<string, ProfilerStats>

Tags

Gets custom tags associated with this report.

public IReadOnlyDictionary<string, string> Tags { get; }

Property Value

IReadOnlyDictionary<string, string>

TotalOperations

Gets the total number of operations tracked.

public int TotalOperations { get; }

Property Value

int

TotalRuntime

Gets the total runtime of the profiling session.

public TimeSpan TotalRuntime { get; }

Property Value

TimeSpan

Methods

CompareTo(ProfileReport, double)

Compares this report to a baseline and identifies regressions.

public ProfileComparison CompareTo(ProfileReport baseline, double thresholdPercent = 10)

Parameters

baseline ProfileReport

Baseline report to compare against.

thresholdPercent double

Threshold percentage for regression detection (default: 10%).

Returns

ProfileComparison

Comparison result with identified regressions.

GetAllStats()

Gets statistics for all operations, sorted by total time descending.

public IReadOnlyList<ProfilerStats> GetAllStats()

Returns

IReadOnlyList<ProfilerStats>

GetHotspots(int)

Gets the top N operations ordered by total time (hotspots).

public IReadOnlyList<ProfilerStats> GetHotspots(int count = 10)

Parameters

count int

Number of operations to return.

Returns

IReadOnlyList<ProfilerStats>

List of statistics for the hottest operations.

GetSlowOperations(double)

Gets operations that exceed the specified P95 threshold.

public IReadOnlyList<ProfilerStats> GetSlowOperations(double p95ThresholdMs)

Parameters

p95ThresholdMs double

Returns

IReadOnlyList<ProfilerStats>

GetStats(string)

Gets statistics for a specific operation.

public ProfilerStats? GetStats(string name)

Parameters

name string

Operation name.

Returns

ProfilerStats

Statistics or null if not found.

GetTopOperations(int)

Gets the top N operations by total time.

public IReadOnlyList<ProfilerStats> GetTopOperations(int count = 10)

Parameters

count int

Returns

IReadOnlyList<ProfilerStats>

ToCsv()

Exports the report to CSV format.

public string ToCsv()

Returns

string

CSV string representation of the report.

ToDictionary()

Exports the report to a dictionary for serialization.

public Dictionary<string, object> ToDictionary()

Returns

Dictionary<string, object>

ToJson()

Exports the report to JSON format.

public string ToJson()

Returns

string

JSON string representation of the report.

ToMarkdown()

Exports the report to Markdown format.

public string ToMarkdown()

Returns

string

Markdown string representation of the report.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.