From 2065b61ef6c6f8677df45aef88c960ad7d805118 Mon Sep 17 00:00:00 2001 From: Peter Goodman Date: Sun, 4 Jun 2017 10:17:25 +1200 Subject: [PATCH] Actually flush measurements batch when batch size is reached. This was resulting in ever increasing batches being sent and not resetting the batch when the max batch size is reached. --- lib/librato.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librato.js b/lib/librato.js index 7ef9321..84f176b 100644 --- a/lib/librato.js +++ b/lib/librato.js @@ -286,7 +286,7 @@ var flushStats = function libratoFlush(ts, metrics) { // Post measurements and clear arrays if past batch size if (measurements.length >= maxBatchSize || writeToLegacy && counters.length + gauges.length >= maxBatchSize) { postMetrics(measureTime, gauges, counters, measurements); - if (measurements >= maxBatchSize) { + if (measurements.length >= maxBatchSize) { measurements = []; } if (counters.length + gauges.length >= maxBatchSize) {