UNPKG

1.91 kBTypeScriptView Raw
1/** @module trace */
2import { TraceTiming } from './TraceTiming';
3import { ITracer } from './ITracer';
4/**
5 * Dummy implementation of tracer that doesn't do anything.
6 *
7 * It can be used in testing or in situations when tracing is required
8 * but shall be disabled.
9 *
10 * @see [[ITracer]]
11 */
12export declare class NullTracer implements ITracer {
13 /**
14 * Creates a new instance of the tracer.
15 */
16 NullTracer(): void;
17 /**
18 * Records an operation trace with its name and duration
19 *
20 * @param correlationId (optional) transaction id to trace execution through call chain.
21 * @param component a name of called component
22 * @param operation a name of the executed operation.
23 * @param duration execution duration in milliseconds.
24 */
25 trace(correlationId: string, component: string, operation: string, duration: number): void;
26 /**
27 * Records an operation failure with its name, duration and error
28 *
29 * @param correlationId (optional) transaction id to trace execution through call chain.
30 * @param component a name of called component
31 * @param operation a name of the executed operation.
32 * @param error an error object associated with this trace.
33 * @param duration execution duration in milliseconds.
34 */
35 failure(correlationId: string, component: string, operation: string, error: Error, duration: number): void;
36 /**
37 * Begings recording an operation trace
38 *
39 * @param correlationId (optional) transaction id to trace execution through call chain.
40 * @param component a name of called component
41 * @param operation a name of the executed operation.
42 * @returns a trace timing object.
43 */
44 beginTrace(correlationId: string, component: string, operation: string): TraceTiming;
45}