Convenience object for collecting timing information. Create it and call start() to create a mark entry for the start of the duration to measure. Later, call end() to create a mark entry for the end of the duration and a measure entry for the duration from the start mark to the end mark. Marks are given a unique identifier to ensure that async, multi-threaded, or reentrant code doesn't have collisions.

WARNING! Will SILENTLY DEACTIVATE ITSELF if the "perfcounters" config option is not set to "true"! This is done to minimize the performance overhead of instrumentation when performance counters are turned off.

The ownerName and functionName are encoded into the name of the performance entry in a way that allows entries to be retrieved using StatsFilters.

Hierarchy

  • Marker

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Marker(ownerName: string, functionName: string, active?: boolean, metricName?: MetricName): Marker
  • Parameters

    • ownerName: string
    • functionName: string
    • Default value active: boolean = performanceApiAvailable() &&config.get("perfcounters") === "true"
    • Default value metricName: MetricName = new MetricName(ownerName,functionName,)

    Returns Marker

Properties

Private Readonly active

active: boolean

Private Readonly metricName

metricName: MetricName

Methods

end

  • end(): this

start

  • start(): this