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

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/monsoon.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 | « no previous file | tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.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.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/monsoon.py b/tools/telemetry/telemetry/core/platform/profiler/monsoon.py
index 13990c28a1eb74f54b46f29fae5c32cd582c2d90..21cb6d2fe7727f2e3c5067034f2f65ff108410b2 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/monsoon.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/monsoon.py
@@ -2,12 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Interface for a USB-connected Monsoon power meter
-(http://msoon.com/LabEquipment/PowerMonitor/).
+"""Interface for a USB-connected Monsoon power meter.
+http://msoon.com/LabEquipment/PowerMonitor/
Currently Unix-only. Relies on fcntl, /dev, and /tmp.
"""
+import collections
import logging
import os
import select
@@ -20,6 +21,9 @@ util.AddDirToPythonPath(util.GetTelemetryDir(), 'third_party', 'pyserial')
import serial # pylint: disable=F0401
+Power = collections.namedtuple('Power', ['amps', 'volts'])
+
+
class Monsoon:
"""Provides a simple class to use the power meter.
@@ -210,7 +214,7 @@ class Monsoon:
sample += ((usb & ~1) - self._coarse_zero) * self._coarse_scale
else:
sample += (usb - self._fine_zero) * self._fine_scale
- out.append((sample, main_voltage_v))
+ out.append(Power(sample, main_voltage_v))
return out
elif packet_type == 1:
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/profiler/monsoon_profiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698