Skip to content

Commit

Permalink
Merge pull request #364 from typingduck/fix20MetricsLimit
Browse files Browse the repository at this point in the history
Fix silent failure publishing to CloudWatch.
  • Loading branch information
dmuino committed Nov 12, 2015
2 parents 0104f7b + c940a58 commit 46aa306
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,13 @@ public void updateImpl(List<Metric> metrics) {
Preconditions.checkNotNull(metrics, "metrics");

List<Metric> batch = new ArrayList<>(batchSize);
int batchCount = 1;

while (!metrics.isEmpty()) {
Metric m = metrics.remove(0);
if (m.hasNumberValue()) {
batch.add(m);

if (batchCount % batchSize == 0) {
++batchCount;
if (batch.size() % batchSize == 0) {
putMetricData(batch);
batch.clear();
}
Expand Down

0 comments on commit 46aa306

Please sign in to comment.