@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

    Constructors

    Properties

    Methods

    Constructors

    Properties

    value?: T
    path: string

    Methods

    • Parameters

      • value: T

      Returns void

    • Type Parameters

      • R extends number | ArrayLike<T>

      Parameters

      • value: R

      Returns void