@adviser/cement - v0.0.0
    Preparing search index...

    Class Metric<T>

    Represents a single metric value that can be tracked and accumulated.

    Metrics can store any type of value and support addition operations for numbers and arrays. Used within the tracing system to collect performance data and custom measurements.

    const counter = new Metric<number>('/api/requests');
    counter.set(0);
    counter.add(1);
    counter.add(5);
    console.log(counter.value); // 6

    Type Parameters

    • T

      The type of the metric value

    Index
    • Type Parameters

      • T

        The type of the metric value

      Parameters

      • path: string

      Returns Metric<T>

    value?: T
    path: string
    • Parameters

      • value: T

      Returns void

    • Type Parameters

      • R extends number | ArrayLike<T>

      Parameters

      • value: R

      Returns void