Update sdk/platform-tools to version 26.0.0.
[android_tools.git] / sdk / platform-tools / systrace / catapult / telemetry / telemetry / internal / platform / power_monitor / __init__.py
blob4c3cf4532cbe3859ba6d966d185a45b76ef7d041
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import logging
7 from telemetry.core import exceptions
10 class PowerMonitor(object):
11 """A power profiler.
13 Provides an interface to register power consumption during a test.
14 """
15 def __init__(self):
16 self._monitoring = False
18 def CanMonitorPower(self):
19 """Returns True iff power can be monitored asynchronously via
20 StartMonitoringPower() and StopMonitoringPower().
21 """
22 return False
24 def CanMeasurePerApplicationPower(self):
25 """Returns True if the power monitor can measure power for the target
26 application in isolation. False if power measurement is for full system
27 energy consumption."""
28 return False
30 def _CheckStart(self):
31 assert not self._monitoring, "Already monitoring power."
32 self._monitoring = True
34 def _CheckStop(self):
35 assert self._monitoring, "Not monitoring power."
36 self._monitoring = False
38 def StartMonitoringPower(self, browser):
39 """Starts monitoring power utilization statistics.
41 See Platform#StartMonitoringPower for the arguments format.
42 """
43 raise NotImplementedError()
45 def StopMonitoringPower(self):
46 """Stops monitoring power utilization and returns collects stats
48 See Platform#StopMonitoringPower for the return format.
49 """
50 raise NotImplementedError()