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

    Show / Hide Table of Contents

    Interface IMetricsCollector

    Collector interface for capturing and recording mutation metrics.

    Namespace: ModularityKit.Mutator.Abstractions.Metrics
    Assembly: ModularityKit.Mutator.dll
    Syntax
    public interface IMetricsCollector
    Remarks

    IMetricsCollector defines the contract for recording, scoping, and aggregating metrics produced during mutation execution. Implementations may store metrics in memory, database, or telemetry systems, allowing analysis of performance, policy evaluation, and state changes.

    Typical usage:

    • Begin a scoped collection for a mutation using BeginScope(string).
    • Record metrics using RecordAsync(string, MutationMetrics, CancellationToken).
    • Retrieve aggregated metrics over a time period using GetAggregatedAsync(DateTimeOffset, DateTimeOffset, CancellationToken).

    Methods

    | Edit this page View Source

    BeginScope(string)

    Begins a metrics collection scope for a given mutation execution.

    Declaration
    IMetricsScope BeginScope(string executionId)
    Parameters
    Type Name Description
    string executionId

    Unique identifier of the mutation execution.

    Returns
    Type Description
    IMetricsScope

    An IMetricsScope which should be disposed when metrics collection ends.

    | Edit this page View Source

    GetAggregatedAsync(DateTimeOffset, DateTimeOffset, CancellationToken)

    Retrieves aggregated metrics over a specified time range.

    Declaration
    Task<AggregatedMetrics> GetAggregatedAsync(DateTimeOffset from, DateTimeOffset to, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    DateTimeOffset from

    Start of the aggregation period.

    DateTimeOffset to

    End of the aggregation period.

    CancellationToken cancellationToken

    Optional cancellation token.

    Returns
    Type Description
    Task<AggregatedMetrics>

    An AggregatedMetrics object containing aggregated results.

    | Edit this page View Source

    RecordAsync(string, MutationMetrics, CancellationToken)

    Records metrics for a specific mutation execution.

    Declaration
    Task RecordAsync(string executionId, MutationMetrics metrics, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string executionId

    Unique identifier of the mutation execution.

    MutationMetrics metrics

    Metrics to record.

    CancellationToken cancellationToken

    Optional cancellation token.

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