Commit Graph

8 Commits

Author SHA1 Message Date
Mengqi Guo
fec861cd49 sweetberry: add microsecond to sweetberry timestamp
This CL adds microsecond to sweetberry timestamp, for more
accuracy in timing sweetberry runs.

This CL is part of the effort to start sweetberry measurements
while running power autotests.

BRANCH=None
BUG=b:68956240
TEST=./powerlog.py -b xxx.board -c xxx.scenario \
--save_stats_json [directory to store it]

Change-Id: I68c40d5be6d684205b49428c4e5cb6e69af6dfdf
Signed-off-by: Mengqi Guo <mqg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/812502
Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
2017-12-07 15:22:49 -08:00
Mengqi Guo
aaf0169b11 sweetberry: print MEAN in json format
This CL adds the flag --save_stats_json which prints the MEAN
of sweetberry readings into json format. Corresponding unit
test has been added too. Printing just the MEAN in json format
makes it easier to read it back in power_telemetry_logger,
which uploads the stats to the dashboard.

This CL is part of the effort to start sweetberry measurements
while running power autotests.

BRANCH=None
BUG=b:68956240
TEST=./powerlog.py -b xxx.board -c xxx.scenario \
--save_stats_json [directory to store it]
python -m  unittest -v stats_manager_unittest

Change-Id: I8274bcac21175f6c53184ced79b6ffe5e7d7a72a
Signed-off-by: Mengqi Guo <mqg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/807636
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
2017-12-05 22:43:45 -08:00
Mengqi Guo
d51eb529b6 sweetberry: save to specified directory
This CL modifies the 2 flags --save_stats and --save_raw_data
so that they can take arguments to save the corresponding file
into directories that we specify. It also provides a new flag
--no_print_raw_data to suppress printing sweetberry readings in
real time.

This CL is part of the effort to start sweetberry measurements
while running power autotests.

BRANCH=None
BUG=b:68956240
TEST=./powerlog.py -b xxx.board -c xxx.scenario \
--save_stats ./xxx --save_raw_data ./xxx --no_print_raw_data

Change-Id: I01ebeafc5f4eebd0a77746e9968367f267e93d83
Signed-off-by: Mengqi Guo <mqg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/756255
Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
2017-11-09 19:16:37 -08:00
Mengqi Guo
6f7d764e50 sweetberry: adding a flag to print milliwatts
Adding a flag to print power numbers in milliwatts instead of
microwatts, to be the same as servo ina board. This will make it
easier for power team to keep track of power numbers in the
future.

BRANCH=None
BUG=b:35578707
TEST=./powerlog.py -b xxx.board -c xxx.scenario --mW
python -m unittest -v stats_manager_unittest

Change-Id: I397da26561324227682404e62ee025384e7624eb
Signed-off-by: Mengqi Guo <mqg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/688743
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
2017-09-29 20:16:20 -07:00
Mengqi Guo
90d8e5460f sweetberry: calculate statistics for sweetberry readings
This CL provides the tool to calculate statistics for sweetberry
readings and present them in a clear & easy to read format. It
also provides the flag to store raw data and statistics
summary, should the need arise.
There are also some code cleanup for powerlog.py.

BRANCH=None
BUG=b:35578707
TEST=./powerlog.py -b xxx.board -c xxx.scenario --print_stats \
--save_stats --save_raw_data
python -m unittest -v stats_manager_unittest

Change-Id: I4aa732756fe6512f37acfcb59b11d950101887d7
Signed-off-by: Mengqi Guo <mqg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/667241
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2017-09-29 17:42:58 -07:00
Nick Sanders
4fc9cf4c11 sweetberry: converter tool for servo_ina
convert_servo_ina.py can convert power log config
files from hdctools/servo/data into sweetberry configs

BRANCH=None
BUG=b:35578707
TEST=compare kevin_r0_loc.py output with kevin.board

Change-Id: Iadc57fe4eb1f5b220c6bffe3a3fe8a10b0d6b5a2
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/634486
2017-08-28 21:15:34 -07:00
Nick Sanders
493b974124 sweetberry: modify powerlog.py to support multiple devices
powerlog.py can now take -A serialA -B serialB to collect data
from both left and right sweetberries simultaneously.

Also, the Spower class has been modified to allow API usage
rather than console only usage.

BRANCH=None
BUG=chromium:608039
TEST=log from both sweetberries on marlin

Signed-off-by: Nick Sanders <nsanders@chromium.org>
Change-Id: Iaeaddad223f35f0e5cad1549b85fa3f7e4d5e1c7
Reviewed-on: https://chromium-review.googlesource.com/422496
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-08-22 21:34:43 -07:00
Nick Sanders
ccff336503 sweetberry: add power logging tool
powerlog.py can access sweetberry and log power data.
Also included are marlin and kevin example board configs.

BUG=chromium:608039
TEST=log power data
BRANCH=None

Change-Id: I0f868d95d17d86522dca045a227a824563f93cd0
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/413293
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-12-16 20:56:49 -08:00