Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TraceTiming

Timing object returned by ITracer.beginTrace to end timing of execution block and record the associated trace.

Example

let timing = tracer.beginTrace("mymethod.exec_time");
try {
    ...
    timing.endTrace();
} catch (err) {
    timing.endFailure(err);
}

Hierarchy

  • TraceTiming

Index

Constructors

Methods

Constructors

constructor

  • new TraceTiming(correlationId: string, component: string, operation: string, tracer?: ITracer): TraceTiming
  • Creates a new instance of the timing callback object.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • component: string

      an associated component name

    • operation: string

      an associated operation name

    • Default value tracer: ITracer = null

    Returns TraceTiming

Methods

endFailure

  • endFailure(error: Error): void
  • Ends timing of a failed block, calculates elapsed time and records the associated trace.

    Parameters

    • error: Error

      an error object associated with this trace.

    Returns void

endTrace

  • endTrace(): void
  • Ends timing of an execution block, calculates elapsed time and records the associated trace.

    Returns void

Generated using TypeDoc