From 380ec034d3cad0348f55ca93f22f27502dc912ad Mon Sep 17 00:00:00 2001 From: Angad Singh Date: Mon, 24 May 2021 10:11:21 +0530 Subject: [PATCH] major bug fix in BufferedFluentMetric.flush this wasted 2 days of my time assuming cloudwatch is dropping metrics when it was this bug here. it seems you haven't even tested your code with more than 20 metrics. --- fluentmetrics/buffer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluentmetrics/buffer.py b/fluentmetrics/buffer.py index 35ecabb..1726b88 100644 --- a/fluentmetrics/buffer.py +++ b/fluentmetrics/buffer.py @@ -62,7 +62,7 @@ def flush(self, send_partial=True): FluentMetric._record_metric(self, page) start = full_pages * PAGE_SIZE - end = len(buffer) % PAGE_SIZE + end = start + (len(buffer) % PAGE_SIZE) if send_partial: # ship remaining items page = buffer[start:end]