Setu-TS
    Preparing search index...

    Hierarchy

    • MetricBase
      • Summary
    Index
    • Creates a new summary.

      Parameters

      • name: string

        Metric name

      • config: MetricConfig

        The metric configuration

      • Optionalquantiles: readonly number[]

        Quantiles to compute (defaults to [0.5, 0.9, 0.99])

      • OptionalmaxSamples: number

        Maximum samples to retain (defaults to 512)

      Returns Summary

    • Gets all quantile data for all observed label sets.

      Returns ReadonlyMap<
          string,
          {
              count: number;
              labels?: Readonly<Record<string, string>>;
              quantiles: ReadonlyMap<number, number>;
              sum: number;
          },
      >

      A map of label keys to their quantiles, sum, and count

    • Gets the count for a label set.

      Parameters

      • Optionallabels: Readonly<Record<string, string>>

        Label values keyed by label name

      Returns number

      The count of all observations

    • Gets the quantile values for a label set.

      Parameters

      • Optionallabels: Readonly<Record<string, string>>

        Label values keyed by label name

      Returns ReadonlyMap<number, number>

      A map of quantiles to values

    • Gets the current sample window size.

      Parameters

      • Optionallabels: Readonly<Record<string, string>>

        Label values keyed by label name

      Returns number

      The number of samples in the window

    • Gets the sum for a label set.

      Parameters

      • Optionallabels: Readonly<Record<string, string>>

        Label values keyed by label name

      Returns number

      The sum of all observations

    • Creates a deterministic key from labels for storage/retrieval. A pure lookup: it reads the key cache but never adds to it, so a getter cannot grow the cache — only MetricBase.seriesKey, for an observed series, does.

      Parameters

      • labels: Readonly<Record<string, string>> | undefined

        The labels to key by

      Returns string

      A deterministic string key

    • Records an observation.

      Parameters

      • value: number

        The observed value

      • Optionallabels: Readonly<Record<string, string>>

        Label values keyed by label name

      Returns void

    • Validates an observation's label snapshot and returns its series key, in one pass when it can. A snapshot (from snapshotLabels) holds only own, enumerable data properties; when it has exactly as many as the configured names, and every configured name is among them, it carries exactly the configured labels — which is what validateLabels checks — provided the configured names are distinct (with ['a', 'a'], the set { a, b } would pass the count and presence test). Anything else takes validateLabels, so an invalid set throws the same error as before.

      Parameters

      • snapshot: Readonly<Record<string, string>> | undefined

        The observation's own copy of its labels

      Returns string

      The series key

      If the labels do not match the configured names

    • Copies the caller's labels once per observation. Validation, the series key and the stored labels all read this copy, so an accessor returning a different value on each read cannot file a series under one label set and export it under another.

      Parameters

      • labels: Readonly<Record<string, string>> | undefined

        The caller's labels

      Returns Readonly<Record<string, string>> | undefined

      A private copy, or undefined when unlabeled (null included)

    • Validates that label names match the configured labels.

      Parameters

      • labels: Readonly<Record<string, string>> | undefined

        The labels to validate

      Returns void

      If label names don't match the config