Skip to content
ModularityKit.Mutator ModularityKit.Mutator Docs
  • Home
  • Core
  • Governance
  • Redis
  • API
Search Results for

    Show / Hide Table of Contents

    Interface IMetricsScope

    Represents a scoped metrics collection for a single mutation execution.

    Inherited Members
    IDisposable.Dispose()
    Namespace: ModularityKit.Mutator.Abstractions.Metrics
    Assembly: ModularityKit.Mutator.dll
    Syntax
    public interface IMetricsScope : IDisposable
    Remarks

    IMetricsScope is used to track metrics related to a specific mutation, such as execution time, validation time, policy evaluation time, state size, and memory usage. It also allows recording custom metrics and building a final MutationMetrics object.

    A typical workflow:

    • Obtain a scope from BeginScope(string).
    • Record individual metrics during mutation execution using the provided methods.
    • Call Build() to get the MutationMetrics object representing the collected data.
    • Dispose the scope after recording is complete.

    Properties

    | Edit this page View Source

    ExecutionId

    Unique identifier for the mutation execution associated with this scope.

    Declaration
    string ExecutionId { get; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    AddCustomMetric(string, object)

    Adds a custom metric with a key and value to the scope.

    Declaration
    void AddCustomMetric(string key, object value)
    Parameters
    Type Name Description
    string key

    Metric key/name.

    object value

    Metric value.

    | Edit this page View Source

    Build()

    Builds the MutationMetrics object representing all collected metrics in this scope.

    Declaration
    MutationMetrics Build()
    Returns
    Type Description
    MutationMetrics

    A MutationMetrics instance.

    | Edit this page View Source

    RecordMemoryUsage(long)

    Records memory usage during mutation execution (in bytes).

    Declaration
    void RecordMemoryUsage(long bytes)
    Parameters
    Type Name Description
    long bytes

    Memory used in bytes.

    | Edit this page View Source

    RecordPolicyEvaluationTime(TimeSpan)

    Records the time spent evaluating policies for the mutation.

    Declaration
    void RecordPolicyEvaluationTime(TimeSpan time)
    Parameters
    Type Name Description
    TimeSpan time

    Duration of policy evaluation.

    | Edit this page View Source

    RecordStateSize(long)

    Records the size of the state before or after mutation (in bytes).

    Declaration
    void RecordStateSize(long bytes)
    Parameters
    Type Name Description
    long bytes

    State size in bytes.

    | Edit this page View Source

    RecordValidationTime(TimeSpan)

    Records the time spent validating the mutation.

    Declaration
    void RecordValidationTime(TimeSpan time)
    Parameters
    Type Name Description
    TimeSpan time

    Duration of validation.

    • Edit this page
    • View Source
    In this article
    ModularityKit.Mutator Generated from XML docs and published from main. Back to top