UNPKG

1.37 kBTypeScriptView Raw
1import * as opentracing from '../index';
2import Reference from '../reference';
3import MockContext from './mock_context';
4import MockTracer from './mock_tracer';
5export interface DebugInfo {
6 uuid: string;
7 operation: string;
8 millis: [number, number, number];
9 tags?: {
10 [key: string]: any;
11 };
12}
13/**
14 * OpenTracing Span implementation designed for use in unit tests.
15 */
16export declare class MockSpan extends opentracing.Span {
17 private _operationName;
18 private _tags;
19 private _logs;
20 _finishMs: number;
21 private _mockTracer;
22 private _uuid;
23 private _startMs;
24 _startStack?: string;
25 protected _context(): MockContext;
26 protected _setOperationName(name: string): void;
27 protected _addTags(set: {
28 [key: string]: any;
29 }): void;
30 protected _log(fields: {
31 [key: string]: any;
32 }, timestamp?: number): void;
33 protected _finish(finishTime?: number): void;
34 constructor(tracer: MockTracer);
35 uuid(): string;
36 operationName(): string;
37 durationMs(): number;
38 tags(): {
39 [key: string]: any;
40 };
41 tracer(): opentracing.Tracer;
42 private _generateUUID;
43 addReference(ref: Reference): void;
44 /**
45 * Returns a simplified object better for console.log()'ing.
46 */
47 debug(): DebugInfo;
48}
49export default MockSpan;
50//# sourceMappingURL=mock_span.d.ts.map
\No newline at end of file