hdctools: dut-control: add repeat (-r, -t) and statistics

Added switches to repeat command.
  -r REPEAT, --repeat=REPEAT
                        repeat requested command multiple times
  -t TIME_IN_SECS, --time_in_secs=TIME_IN_SECS
                        repeat requested command forthis many seconds

When activated it will also print stats if 'get' is numeric

@@            NAME  COUNT  AVERAGE  STDDEV   MAX   MIN
@@    sample_msecs    400     5.00    0.21     8     4
@@   ppvar_vbat_ma    400  3586.92   79.78  3952  3443

BUG=none
TEST=manual,

prereq:
-------
servod -c servo.xml -c servo_loc.xml
dut-control i2c_mux_en:on i2c_mux:loc0

dut-control -r 100 loc_0x40_mv
dut-control -t 2 loc_0x40_mv

Change-Id: Idab2bdae9fe74a4925f52f2491badde7445e14cc
Reviewed-on: http://gerrit.chromium.org/gerrit/5018
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
1 file changed