Skip to content

Commit

Permalink
always show avg power
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Jul 5, 2022
1 parent 0bf1462 commit d4f4809
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/zookeeper/power_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
while duration is None or time.monotonic() - start_time < duration:
fltr.update(z.read_power())
if rk.frame % rate == 0:
print(f"{fltr.x:.2f} W")
measurements.append(fltr.x)
t = datetime.timedelta(seconds=time.monotonic() - start_time)
avg = sum(measurements) / len(measurements)
print(f"Now: {fltr.x:.2f} W, Avg: {avg:.2f} W over {t}")
rk.keep_time()
except KeyboardInterrupt:
pass
Expand Down

0 comments on commit d4f4809

Please sign in to comment.