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

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

Issue 185643005: [telemetry] Fix Monsoon profiler, name result fields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/telemetry/telemetry/core/platform/profiler/monsoon.py ('k') | no next file » | 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 62cb5c34768ed4cb67f2c1e1e0ac58ef717ba3ff..1c5e3d637e7a662285bc13c8dbac7fd6b5033678 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.py
@@ -2,6 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+"""Profiler using data collected from a Monsoon power meter.
+
+http://msoon.com/LabEquipment/PowerMonitor/
+Data collected is a namedtuple of (amps, volts), at 5000 samples/second.
+Output graph plots power in watts over time in seconds.
+"""
+
import csv
import multiprocessing
@@ -34,7 +41,8 @@ def _CollectData(output_path, is_collecting):
mon.StopDataCollection()
# Add x-axis labels.
- plot_data = [(i / 5000., sample(0)) for i, sample in enumerate(samples)]
+ plot_data = [(i / 5000., sample.amps * sample.volts)
+ for i, sample in enumerate(samples)]
# Print data in csv.
with open(output_path, 'w') as output_file:
@@ -48,11 +56,6 @@ def _CollectData(output_path, is_collecting):
class MonsoonProfiler(profiler.Profiler):
- """Profiler that tracks current using Monsoon Power Monitor.
-
- http://www.msoon.com/LabEquipment/PowerMonitor/
- The Monsoon device measures current in amps at 5000 samples/second.
- """
def __init__(self, browser_backend, platform_backend, output_path, state):
super(MonsoonProfiler, self).__init__(
browser_backend, platform_backend, output_path, state)
« no previous file with comments | « tools/telemetry/telemetry/core/platform/profiler/monsoon.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698