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

TEST=added unit tests and ran them, seems to work fine.

Change-Id: I372df1b04163f6704ffdc27b363dcabc7c78fb2a
Signed-off-by: Ruben Rodriguez Buchillon <>
Reviewed-by: Mengqi Guo <>
2 files changed