Class FoundryPerformanceStatistics
- Namespace
- WorkflowForge.Extensions.Observability.Performance
- Assembly
- WorkflowForge.Extensions.Observability.Performance.dll
Thread-safe aggregate of foundry performance statistics, collected across all operations executed while performance monitoring is enabled. Populated by PerformanceStatisticsMiddleware and retrieved via GetPerformanceStatistics(IWorkflowFoundry).
public sealed class FoundryPerformanceStatistics : IFoundryPerformanceStatistics
- Inheritance
-
FoundryPerformanceStatistics
- Implements
- Inherited Members
Constructors
FoundryPerformanceStatistics(ISystemTimeProvider?)
Initializes a new instance of the FoundryPerformanceStatistics class.
public FoundryPerformanceStatistics(ISystemTimeProvider? timeProvider = null)
Parameters
timeProviderISystemTimeProviderOptional time provider (defaults to the system clock).
Properties
AverageDuration
Gets the average execution duration across all operations.
public TimeSpan AverageDuration { get; }
Property Value
AverageMemoryPerOperation
Gets the average memory allocated per operation.
public long AverageMemoryPerOperation { get; }
Property Value
EndTime
Gets the timestamp when statistics collection ended or current time if still running.
public DateTimeOffset EndTime { get; }
Property Value
FailedOperations
Gets the number of failed operations.
public int FailedOperations { get; }
Property Value
MaximumDuration
Gets the maximum execution duration recorded.
public TimeSpan MaximumDuration { get; }
Property Value
MinimumDuration
Gets the minimum execution duration recorded.
public TimeSpan MinimumDuration { get; }
Property Value
OperationsPerSecond
Gets the operations per second throughput.
public double OperationsPerSecond { get; }
Property Value
StartTime
Gets the timestamp when statistics collection started.
public DateTimeOffset StartTime { get; }
Property Value
SuccessRate
Gets the overall success rate as a percentage (0.0 to 1.0).
public double SuccessRate { get; }
Property Value
SuccessfulOperations
Gets the number of successfully completed operations.
public int SuccessfulOperations { get; }
Property Value
TotalDuration
Gets the total duration of the foundry execution.
public TimeSpan TotalDuration { get; }
Property Value
TotalMemoryAllocated
Gets the total memory allocated during foundry operations.
public long TotalMemoryAllocated { get; }
Property Value
TotalOperations
Gets the total number of operations executed in the foundry.
public int TotalOperations { get; }
Property Value
Methods
GetAllOperationStatistics()
Gets performance statistics for all operations.
public IReadOnlyList<IOperationStatistics> GetAllOperationStatistics()
Returns
- IReadOnlyList<IOperationStatistics>
A collection of operation statistics.
GetOperationStatistics(string)
Gets detailed statistics for a specific operation by name.
public IOperationStatistics? GetOperationStatistics(string operationName)
Parameters
operationNamestringThe name of the operation.
Returns
- IOperationStatistics
Operation-specific statistics or null if not found.
Record(string, string, TimeSpan, bool, long)
Records a single operation execution into the aggregate and per-operation statistics.
public void Record(string operationName, string operationId, TimeSpan duration, bool success, long memoryAllocated)