Class MeasurementUtil<T>

Wrapper over node perf hooks. T is a user defined string union of the targets that are being measured (e.g. 'wallet-initialization | input-selection').

Type Parameters

  • T extends string

Hierarchy

  • MeasurementUtil

Constructors

Properties

#performanceObserver: PerformanceObserver

Methods

  • Adds a measurement marker in the timeline for target with id. It measures the time since addStartMarker with the same target and id was called. If useStopMarker is specified, it measures the time between addStartMarker and addStopMarker called with the same target and id.

    Parameters

    • target: T
    • id: number
    • useStopMarker: boolean = false

      Values:

      • false | undefined: Measure from start marker until this measure marker.
      • true: Measure from start marker until the associated stop marker.

    Returns void

  • Add a start time marker in the timeline.

    Parameters

    • target: T

      target for which we are setting the marker (e.g. 'wallet-initialization').

    • id: number

      a unique numeric id useful when monitoring many instances. Statistics are aggregated for all ids.

    Returns void

  • Add a stop time marker in the timeline. Useful when the addMeasureMarker is done separately/later than the start&stop markers. In that case, the measurement is done from startMarker to stopMarker, instead of startMarker to measurementMarker.

    Parameters

    Returns void

Generated using TypeDoc