Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.py

Issue 185953004: Add some statistics to the monsoon profile run (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to apply upon latest trunk Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/metrics/statistics_unittest.py ('k') | tools/telemetry/telemetry/util/statistics.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.py
index 54bb3dc83286d5b1ee602b16a6c17bd3584006fd..0ee10c730fbac0341f4542323bd09bd1286bf180 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.py
@@ -15,6 +15,7 @@ import multiprocessing
from telemetry.core import exceptions
from telemetry.core.platform import profiler
from telemetry.core.platform.profiler import monsoon
+from telemetry.util import statistics
def _CollectData(output_path, is_collecting):
@@ -49,6 +50,15 @@ def _CollectData(output_path, is_collecting):
output_writer.writerows(plot_data)
output_file.flush()
+ power_samples = [s.amps * s.volts for s in samples]
+
+ print 'Monsoon profile power readings in watts:'
+ print (' Total = %f' % statistics.TrapezoidalRule(power_samples, 1/5000.))
+ print (' Average = %f' % statistics.ArithmeticMean(power_samples) +
+ '+-%f' % statistics.StandardDeviation(power_samples))
+ print (' Peak = %f' % max(power_samples))
+ print (' Duration = %f' % (len(power_samples) / 5000.))
+
print 'To view the Monsoon profile, run:'
print (' echo "set datafile separator \',\'; plot \'%s\' with lines" | '
'gnuplot --persist' % output_path)
« no previous file with comments | « tools/perf/metrics/statistics_unittest.py ('k') | tools/telemetry/telemetry/util/statistics.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698