servod: add data trimming to TimelinedStatsManager

This CL introduces the ability to trim to data inside a
TimelinedStatsManager to only the samples where tstart <= t <= tend for
the timeline. This trimming process is in place and operates on the raw
data of the TimelinedStatsmanager.
The logic for this is from: go/power-status-numpy-magic

BUG=chromium:806146
TEST=added unit tests and ran them, seems to work fine.

Change-Id: I372df1b04163f6704ffdc27b363dcabc7c78fb2a
Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1163595
Reviewed-by: Mengqi Guo <mqg@chromium.org>
2 files changed