telemetry.internal.platform.power_monitor.sysfs_power_monitor | index telemetry/internal/platform/power_monitor/sysfs_power_monitor.py

`# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.`

Modules
`` |  |
collections telemetry.decorators | logging os | telemetry.internal.platform.power_monitor re |

Classes
`` |  | telemetry.internal.platform.power_monitor.PowerMonitor(__builtin__.object) SysfsPowerMonitor
class SysfsPowerMonitor(telemetry.internal.platform.power_monitor.PowerMonitor)
`` | `PowerMonitor that relies on sysfs to monitor CPU statistics on several different platforms.`
| Method resolution order: SysfsPowerMonitor telemetry.internal.platform.power_monitor.PowerMonitor __builtin__.object Methods defined here: CanMonitorPower(*args, **kwargs) GetCpuFreq(self) `Retrieve CPU frequency times from the device. Returns: Dictionary containing frequency times for each CPU.` GetCpuState(self) `Retrieve CPU c-state residency times from the device. Returns: Dictionary containing c-state residency times for each CPU.` StartMonitoringPower(self, _browser) StopMonitoringPower(self) __init__(self, linux_based_platform_backend, standalone=False) `Constructor. Args: linux_based_platform_backend: A LinuxBasedPlatformBackend object. standalone: If it is not wrapping another monitor, set to True. Attributes: _cpus: A list of the CPUs on the target device. _end_time: The time the test stopped monitoring power. _final_cstate: The c-state residency times after the test. _final_freq: The CPU frequency times after the test. _initial_cstate: The c-state residency times before the test. _initial_freq: The CPU frequency times before the test. _platform: A LinuxBasedPlatformBackend object associated with the target platform. _start_time: The time the test started monitoring power.` Static methods defined here: CombineResults(cpu_stats, power_stats) `Add frequency and c-state residency data to the power data. Args: cpu_stats: Dictionary containing CPU statistics. power_stats: Dictionary containing power statistics. Returns: Dictionary in the format returned by StopMonitoringPower.` ComputeCpuStats(initial, final) `Parse the CPU c-state and frequency values saved during monitoring. Args: initial: The parsed dictionary of initial statistics to be converted into percentages. final: The parsed dictionary of final statistics to be converted into percentages. Returns: Dictionary containing percentages for each CPU as well as an average across all CPUs.` ParseFreqSample(sample) `Parse a single frequency sample. Args: sample: The single sample of frequency data to be parsed. Returns: A dictionary associating a frequency with a time.` Methods inherited from telemetry.internal.platform.power_monitor.PowerMonitor: CanMeasurePerApplicationPower(self) `Returns True if the power monitor can measure power for the target application in isolation. False if power measurement is for full system energy consumption.` Data descriptors inherited from telemetry.internal.platform.power_monitor.PowerMonitor: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`

Data
`` |  | CPU_PATH = '/sys/devices/system/cpu/'