Options
All
  • Public
  • Public/Protected
  • All
Menu

Module core/metrics/utils

Index

Functions

createMetric

  • A metric factory function.

    throws
    • In case type is not listed in the METRIC_MAP;
    • In case v is not in the correct representation for the wanted metric type.

    Parameters

    • type: string

      The type of the metric to create.

    • v: unknown

      The value with which to instantiate the metric.

    Returns Metric<JSONValue, JSONValue>

    A metric instance.

validateMetricInternalRepresentation

  • validateMetricInternalRepresentation<T>(type: string, v: unknown): v is T
  • Validates that a given value is in the correct internal representation format for a metric of a given type.

    Type parameters

    Parameters

    • type: string

      The type of the metric to validate

    • v: unknown

      The value to verify

    Returns v is T

    Whether or not v is of the correct type.

Generated using TypeDoc