Options
All
  • Public
  • Public/Protected
  • All
Menu

Timer Trait Class

This class is not used as standalone and it cannot be instantiated by itself. Its prototype is copied to classes like Gauge, Histogram or Summary to fulfill the timing functionality.

Hierarchy

  • Timer

Index

Methods

Methods

startTimer

  • Timer initialization method

    const gauge = new Gauge('timing_is_everything');
    const endTimer = gauge.startTimer();
    setTimeout(endTimer, 2000);
    // or
    setTimeout(() => { endTimer(/* list of tags *\/); }, 2000)

    Parameters

    • Optional tags: Tags

      Optional tags to be sent with the metric

    Returns TimerEnd

    A function that needs to be called when the timer should end. The end method has a Tags argument as well, giving you the possibility to add additional tags at end of timer call.

Legend

  • Property
  • Method
  • Constructor
  • Method
  • Inherited method
  • Protected property
  • Static method

Generated using TypeDoc