Use an object for the queue of unsent events
MODIFY
lib/reporter-proxy.js
lib/reporter-proxy.js
@@ -11,7 +11,7 @@ module.exports = class ReporterProxy {
let timingsEvent
while ((timingsEvent = this.timingsQueue.shift())) {
- this.reporter.addTiming(this.eventType, timingsEvent[0], timingsEvent[1])
+ this.reporter.addTiming(this.eventType, timingsEvent.duration, timingsEvent.metadata)
}
}
@@ -32,7 +32,7 @@ module.exports = class ReporterProxy {
if (this.reporter) {
this.reporter.addTiming(this.eventType, duration, metadata)
} else {
- this.timingsQueue.push([duration, metadata])
+ this.timingsQueue.push({duration, metadata})
}
}
}

Use an object for the queue of unsent events