Open r0b0ji opened 1 year ago
Also, in the original formula the absolute value of diff need to be taken to avoid getting negative rate impacting the avg and other stats for Time to drain metric. Time to drain can't be negative, if there is no message it will be 0 but current formula adds negative datapoints (though the visibility is capped at 0 min but datapoint are still negative) and which reduces the avg .
Version
v5.2.3
Steps and/or minimal code example to reproduce
It is not actually a bug but a better and simpler computation exist. Currently, time to drain metrics in SQS is calculated as below [1] , which is indirect. A better estimate can be calculated using RATE function [2].
Expected behavior
Instead of directly getting the consumption rate, current computation estimate based on different metrics which is less accurate.
Actual behavior
A better and direct method can be used.
Other details
A sample code for this is