Class MutationMetrics
Captures execution metrics for a single mutation operation.
Implements
Inherited Members
Namespace: ModularityKit.Mutator.Abstractions.Metrics
Assembly: ModularityKit.Mutator.dll
Syntax
public sealed record MutationMetrics : IEquatable<MutationMetrics>
Remarks
MutationMetrics provides detailed performance and operational metrics for a mutation, including timing, policy evaluations, state changes, memory usage, and caching behavior. These metrics are typically collected by the Mutators framework for auditing, monitoring, and optimization purposes.
Key considerations:
- ExecutionTime measures the total duration of the mutation.
- ValidationTime measures time spent validating the mutation.
- PolicyEvaluationTime measures time spent evaluating policies.
- ValidatedRules and EvaluatedPolicies track the number of rules/policies processed.
- ChangesCount counts state changes applied.
- StateSize and MemoryUsed provide insights into resource consumption.
- UsedCache indicates if a cache was leveraged.
- AdditionalMetrics allows extensibility for custom metrics.
Properties
| Edit this page View SourceAdditionalMetrics
Additional custom metrics.
Declaration
public IReadOnlyDictionary<string, object> AdditionalMetrics { get; init; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, object> |
ChangesCount
Number of state changes applied.
Declaration
public int ChangesCount { get; init; }
Property Value
| Type | Description |
|---|---|
| int |
EvaluatedPolicies
Number of policies evaluated during the mutation.
Declaration
public int EvaluatedPolicies { get; init; }
Property Value
| Type | Description |
|---|---|
| int |
ExecutionTime
Total execution time of the mutation.
Declaration
public TimeSpan ExecutionTime { get; init; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
MemoryUsed
Memory used during mutation execution (in bytes).
Declaration
public long? MemoryUsed { get; init; }
Property Value
| Type | Description |
|---|---|
| long? |
PolicyEvaluationTime
Time spent evaluating policies.
Declaration
public TimeSpan PolicyEvaluationTime { get; init; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
RecordedAt
Timestamp when the mutation was recorded.
Declaration
public DateTimeOffset RecordedAt { get; init; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset |
StateSize
Size of the state before the mutation (in bytes, if applicable).
Declaration
public long? StateSize { get; init; }
Property Value
| Type | Description |
|---|---|
| long? |
UsedCache
Indicates whether a cache was used.
Declaration
public bool UsedCache { get; init; }
Property Value
| Type | Description |
|---|---|
| bool |
ValidatedRules
Number of rules validated during the mutation.
Declaration
public int ValidatedRules { get; init; }
Property Value
| Type | Description |
|---|---|
| int |
ValidationTime
Time spent validating the mutation.
Declaration
public TimeSpan ValidationTime { get; init; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |