|
14 | 14 | * limitations under the License.
|
15 | 15 | */
|
16 | 16 |
|
17 |
| -import {Exporter, ExporterBuffer, ExporterConfig, RootSpan, Span} from '@opencensus/core'; |
| 17 | +import {Exporter, ExporterConfig, RootSpan, Span} from '@opencensus/core'; |
18 | 18 | import {logger, Logger} from '@opencensus/core';
|
19 | 19 | import * as os from 'os';
|
20 |
| - |
21 | 20 | import {spanToThrift, Tag, TagValue, ThriftProcess, ThriftUtils, UDPSender, Utils} from './jaeger-driver';
|
22 | 21 |
|
| 22 | +const DEFAULT_BUFFER_FLUSH_INTERVAL_MILLIS = 1000; |
| 23 | +const DEFAULT_BUFFER_SIZE = 1000; |
| 24 | + |
23 | 25 | /**
|
24 | 26 | * Options for Jaeger configuration
|
25 | 27 | */
|
@@ -53,17 +55,16 @@ export class JaegerTraceExporter implements Exporter {
|
53 | 55 | /** Timeout control */
|
54 | 56 | /** Max time for a buffer can wait before being sent */
|
55 | 57 | private bufferTimeout: number;
|
56 |
| - /** Manage when the buffer timeout needs to be reseted */ |
57 |
| - private resetTimeout = false; |
58 | 58 | /** Indicates when the buffer timeout is running */
|
59 | 59 | private timeoutSet = false;
|
60 | 60 |
|
61 | 61 |
|
62 | 62 | constructor(options: JaegerTraceExporterOptions) {
|
63 | 63 | const pjson = require('../../package.json');
|
64 | 64 | this.logger = options.logger || logger.logger();
|
65 |
| - this.bufferTimeout = options.bufferTimeout; |
66 |
| - this.bufferSize = options.bufferSize; |
| 65 | + this.bufferTimeout = |
| 66 | + options.bufferTimeout || DEFAULT_BUFFER_FLUSH_INTERVAL_MILLIS; |
| 67 | + this.bufferSize = options.bufferSize || DEFAULT_BUFFER_SIZE; |
67 | 68 | this.sender = new UDPSender(options);
|
68 | 69 | const tags: Tag[] = options.tags || [];
|
69 | 70 |
|
|
0 commit comments