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
StartTime
Gets the start time of the profiling session.
public DateTime StartTime { get; }
Property Value
Stats
Gets a dictionary of operation name to statistics.
public IReadOnlyDictionary<string, ProfilerStats> Stats { get; }
Property Value
Tags
Gets custom tags associated with this report.
public IReadOnlyDictionary<string, string> Tags { get; }
Property Value
TotalOperations
Gets the total number of operations tracked.
public int TotalOperations { get; }
Property Value
TotalRuntime
Gets the total runtime of the profiling session.
public TimeSpan TotalRuntime { get; }
Property Value
Methods
CompareTo(ProfileReport, double)
Compares this report to a baseline and identifies regressions.
public ProfileComparison CompareTo(ProfileReport baseline, double thresholdPercent = 10)
Parameters
baselineProfileReportBaseline report to compare against.
thresholdPercentdoubleThreshold 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
GetHotspots(int)
Gets the top N operations ordered by total time (hotspots).
public IReadOnlyList<ProfilerStats> GetHotspots(int count = 10)
Parameters
countintNumber 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
p95ThresholdMsdouble
Returns
GetStats(string)
Gets statistics for a specific operation.
public ProfilerStats? GetStats(string name)
Parameters
namestringOperation 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
countint
Returns
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
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.