Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
Actually flush measurements batch when batch size is reached. (#93)
Browse files Browse the repository at this point in the history
This was resulting in ever increasing batches being sent and not resetting the batch when the max batch size is reached.
  • Loading branch information
PeteGoo authored and bryanmikaelian committed Jun 5, 2017
1 parent 027a0b0 commit 0bd014c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/librato.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0bd014c

Please sign in to comment.