Interface: IPerformanceWorkflow

Workflow to monitor for performance

Properties

context

readonlycontext: Readonly<IContext>

Contextual information about the workflow


id

readonlyid: string

ID

Unique identifier for a particular instance of the workflow


name

readonlyname: string

Name

Describes the workflow action


startTime

readonlystartTime: number

The high-resolution timestamp indicating when the workflow started (or undefined if the workflow has not yet been started)

Methods

checkpoint()

checkpoint(name): this

Creates an IPerformanceCheckpoint for the workflow

Parameters

name: string

Name of the checkpoint

Returns

this


checkpointWithEndName()

checkpointWithEndName(startName, endName): IPerformanceCheckpoint

Creates an IPerformanceCheckpoint for the workflow and returns the checkpoint containing the verified end name

Parameters

startName: string

Name of the checkpoint

endName: string

Name of the checkpoint

Returns

IPerformanceCheckpoint


complete()

complete(report?): this

Marks the workflow as complete and optionally reports it

Parameters

report?: boolean

Whether or not the workflow should be reported (If no value passed, the autoReport option will be used. If no autoReport option was specified, this defaults to true.)

Returns

this


getCheckpoint()

getCheckpoint(name): IPerformanceCheckpoint

Retrieves a checkpoint by name

Parameters

name: string

Name of the checkpoint

Returns

IPerformanceCheckpoint


getCheckpointTimeFromStart()

getCheckpointTimeFromStart(checkpointName): number

Retrieves the time value difference between the workflow start time and the specified checkpoint in milliseconds

Parameters

checkpointName: string

name of the checkpoint

Returns

number


getDuration()

getDuration(startCheckpoint, endCheckpoint): number

Retrieves the time value difference between 2 checkpoints in milliseconds

Parameters

startCheckpoint: string

name of the start checkpoint

endCheckpoint: string

name of the end checkpoint

Returns

number


incrementContext()

incrementContext(key): this

Attempts to increment a context property

If the property does not yet exist, it will create it and set it to 1. If the property exists and is a number, it will be incremented by 1. If the property exists but is not a number, an error will be thrown.

Parameters

key: string

Context property name to attempt to increment

Returns

this


setContext()

setContext(key, value, override?): this

Assigns a context property

Parameters

key: string

Context property name

value: ApmCustomData

Context property value

override?: boolean

Whether or not to override the existing value (Defaults to false)

Returns

this


start()

start(startTime?): this

Marks the start of the workflow

Parameters

startTime?: number

Returns

this