| commit | 613a7e2a7dc7f7e9f215390fd5138187c7d17b3c | [log] [tgz] |
|---|---|---|
| author | Yangster <yanglu@google.com> | Tue May 08 15:12:30 2018 -0700 |
| committer | Yangster <yanglu@google.com> | Tue May 08 15:12:30 2018 -0700 |
| tree | c887da8c968ab4f43d67490a82051218c2fa1e68 | |
| parent | 8ea760c8158b27129a9838338d209d8841be0cc0 [diff] |
Should not use the absolute value when the value does not change. Test: statsd test BUG: b/79265262 Change-Id: Ic654e1a07a505ec0e073a41fb41bcd38a29b125e
diff --git a/cmds/statsd/src/metrics/ValueMetricProducer.cpp b/cmds/statsd/src/metrics/ValueMetricProducer.cpp index 69330ba..df8763c 100644 --- a/cmds/statsd/src/metrics/ValueMetricProducer.cpp +++ b/cmds/statsd/src/metrics/ValueMetricProducer.cpp
@@ -396,7 +396,7 @@ // If not, there was a reset event. We take the absolute value as // diff in this case. if (interval.startUpdated) { - if (value > interval.start) { + if (value >= interval.start) { interval.sum += (value - interval.start); } else { interval.sum += value;