Class PerformanceMetrics
- Namespace
- DotCompute.Abstractions.Performance
- Assembly
- DotCompute.Abstractions.dll
Comprehensive performance metrics collection for DotCompute operations. This is the canonical PerformanceMetrics type used across all projects.
public sealed class PerformanceMetrics
- Inheritance
-
PerformanceMetrics
- Inherited Members
Properties
AverageTimeMs
Gets or sets the average execution time in milliseconds.
public double AverageTimeMs { get; set; }
Property Value
CacheHitRate
Gets or sets the cache hit rate percentage (0.0 to 100.0).
public double CacheHitRate { get; set; }
Property Value
CallCount
Gets or sets the number of times this operation was called.
public int CallCount { get; set; }
Property Value
ComputeUtilization
Gets or sets the compute utilization percentage (0.0 to 100.0).
public double ComputeUtilization { get; set; }
Property Value
CustomMetrics
Gets or sets additional custom metrics specific to the backend or operation.
public Dictionary<string, object> CustomMetrics { get; }
Property Value
ErrorMessage
Gets or sets the error information if the operation failed.
public string? ErrorMessage { get; set; }
Property Value
ExecutionTimeMs
Gets or sets the execution time in milliseconds.
public long ExecutionTimeMs { get; set; }
Property Value
IsSuccessful
Gets a value indicating whether the operation completed successfully.
public bool IsSuccessful { get; }
Property Value
KernelExecutionTimeMs
Gets or sets the kernel execution time in milliseconds (GPU-specific).
public long KernelExecutionTimeMs { get; set; }
Property Value
MaxTimeMs
Gets or sets the maximum execution time in milliseconds.
public double MaxTimeMs { get; set; }
Property Value
MemoryTransferTimeMs
Gets or sets the memory transfer time in milliseconds.
public long MemoryTransferTimeMs { get; set; }
Property Value
MemoryUsageBytes
Gets or sets the memory usage in bytes.
public long MemoryUsageBytes { get; set; }
Property Value
MemoryUtilization
Gets or sets the memory utilization percentage (0.0 to 100.0).
public double MemoryUtilization { get; set; }
Property Value
MinTimeMs
Gets or sets the minimum execution time in milliseconds.
public double MinTimeMs { get; set; }
Property Value
Operation
Gets or sets the name or description of the operation being measured.
public string Operation { get; set; }
Property Value
OperationsPerSecond
Gets or sets the number of operations per second.
public long OperationsPerSecond { get; set; }
Property Value
PeakMemoryUsageBytes
Gets or sets the peak memory usage in bytes.
public long PeakMemoryUsageBytes { get; set; }
Property Value
StandardDeviation
Gets or sets the standard deviation of execution times.
public double StandardDeviation { get; set; }
Property Value
ThroughputGBps
Gets or sets the throughput in gigabytes per second.
public double ThroughputGBps { get; set; }
Property Value
Timestamp
Gets or sets the timestamp when these metrics were collected.
public DateTimeOffset Timestamp { get; set; }
Property Value
TotalExecutionTimeMs
Gets or sets the total execution time including all operations.
public long TotalExecutionTimeMs { get; set; }
Property Value
TotalFlops
Gets or sets the total floating point operations performed.
public long TotalFlops { get; set; }
Property Value
Methods
Aggregate(IEnumerable<PerformanceMetrics>)
Merges multiple performance metrics into a single aggregated result.
public static PerformanceMetrics Aggregate(IEnumerable<PerformanceMetrics> metrics)
Parameters
metricsIEnumerable<PerformanceMetrics>The metrics to merge.
Returns
- PerformanceMetrics
An aggregated PerformanceMetrics instance.
FromStopwatch(Stopwatch, string)
Creates a new PerformanceMetrics instance with basic timing information.
public static PerformanceMetrics FromStopwatch(Stopwatch stopwatch, string operation = "")
Parameters
stopwatchStopwatchThe stopwatch used to measure execution time.
operationstringThe name of the operation.
Returns
- PerformanceMetrics
A new PerformanceMetrics instance.
FromTimeSpan(TimeSpan, string)
Creates a new PerformanceMetrics instance with timing information from a TimeSpan.
public static PerformanceMetrics FromTimeSpan(TimeSpan elapsed, string operation = "")
Parameters
Returns
- PerformanceMetrics
A new PerformanceMetrics instance.
ToString()
Returns a string representation of the performance metrics.
public override string ToString()