Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9342c3d4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "similar to the samplers in batterystats, when we do diff, if the value...

Merge "similar to the samplers in batterystats, when we do diff, if the value is not monotically increasing, we should take the absolute value as the diff."
parents 4d7cc1a3 0ed268b1
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -285,8 +285,15 @@ void ValueMetricProducer::onMatchedLogEventInternalLocked(
            interval.start = value;
            interval.startUpdated = true;
        } else {
            // Generally we expect value to be monotonically increasing.
            // If not, there was a reset event. We take the absolute value as
            // diff in this case.
            if (interval.startUpdated) {
                if (value > interval.start) {
                    interval.sum += (value - interval.start);
                } else {
                    interval.sum += value;
                }
                interval.startUpdated = false;
            } else {
                VLOG("No start for matching end %ld", value);