1515 */
1616
1717import * as uuidv4 from 'uuid/v4' ;
18-
19- import { debug } from '../internal/util' ;
20- import { RootSpan } from '../trace/model/types' ;
21- import { OnEndSpanEventListener } from '../trace/model/types' ;
22- import { Logger } from '../common/types' ;
23- import { Exporter } from './types' ;
24- import { Config , BufferConfig } from '../trace/config/types' ;
25-
18+ import * as types from './types' ;
19+ import * as modelTypes from '../trace/model/types' ;
20+ import * as configTypes from '../trace/config/types' ;
21+ import * as loggerTypes from '../common/types' ;
2622import * as logger from '../common/console-logger' ;
2723
2824
2925/** Controls the sending of traces to exporters. */
3026export class Buffer {
3127 /** The service to send the collected spans. */
32- private exporter : Exporter ;
28+ private exporter : types . Exporter ;
3329 /** Maximum size of a buffer. */
3430 private bufferSize : number ;
3531 /** Max time for a buffer can wait before being sent */
@@ -39,16 +35,16 @@ export class Buffer {
3935 /** Indicates when the buffer timeout is running */
4036 private bufferTimeoutInProgress = false ;
4137 /** An object to log information to */
42- logger : Logger ;
38+ logger : loggerTypes . Logger ;
4339 /** Trace queue of a buffer */
44- queue : RootSpan [ ] = [ ] ;
40+ queue : modelTypes . RootSpan [ ] = [ ] ;
4541
4642 /**
4743 * Constructs a new Buffer instance.
4844 * @param exporter The service to send the collected spans.
4945 * @param config A buffer configuration object to create a buffer.
5046 */
51- constructor ( exporter : Exporter , config : BufferConfig ) {
47+ constructor ( exporter : types . Exporter , config : configTypes . BufferConfig ) {
5248 this . exporter = exporter ;
5349 this . logger = config . logger || logger . logger ( ) ;
5450 this . bufferSize = config . bufferSize ;
@@ -69,7 +65,7 @@ export class Buffer {
6965 * Add a trace (rootSpan) in the buffer.
7066 * @param trace RootSpan to be added in the buffer.
7167 */
72- addToBuffer ( trace : RootSpan ) {
68+ addToBuffer ( trace : modelTypes . RootSpan ) {
7369 this . queue . push ( trace ) ;
7470 this . logger . debug ( 'BUFFER: added new trace' ) ;
7571
0 commit comments