| |
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html><head><title>Python: package telemetry.core.platform</title> |
| </head><body bgcolor="#f0f0f8"> |
| |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| <tr bgcolor="#7799ee"> |
| <td valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.platform</strong></big></big></font></td |
| ><td align=right valign=bottom |
| ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/platform/__init__.py">telemetry/core/platform/__init__.py</a></font></td></tr></table> |
| <p><tt># Copyright (c) 2012 The Chromium Authors. All rights reserved.<br> |
| # Use of this source code is governed by a BSD-style license that can be<br> |
| # found in the LICENSE file.</tt></p> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#aa55cc"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.platform.android_platform_backend.html">android_platform_backend</a><br> |
| <a href="telemetry.core.platform.android_platform_backend_unittest.html">android_platform_backend_unittest</a><br> |
| <a href="telemetry.core.platform.cros_platform_backend.html">cros_platform_backend</a><br> |
| <a href="telemetry.core.platform.desktop_platform_backend.html">desktop_platform_backend</a><br> |
| <a href="telemetry.core.platform.factory.html">factory</a><br> |
| </td><td width="25%" valign=top><a href="telemetry.core.platform.linux_platform_backend.html">linux_platform_backend</a><br> |
| <a href="telemetry.core.platform.mac_platform_backend.html">mac_platform_backend</a><br> |
| <a href="telemetry.core.platform.mac_platform_backend_unittest.html">mac_platform_backend_unittest</a><br> |
| <a href="telemetry.core.platform.platform_backend.html">platform_backend</a><br> |
| <a href="telemetry.core.platform.platform_backend_unittest.html">platform_backend_unittest</a><br> |
| </td><td width="25%" valign=top><a href="telemetry.core.platform.posix_platform_backend.html">posix_platform_backend</a><br> |
| <a href="telemetry.core.platform.posix_platform_backend_unittest.html">posix_platform_backend_unittest</a><br> |
| <a href="telemetry.core.platform.power_monitor.html"><strong>power_monitor</strong> (package)</a><br> |
| <a href="telemetry.core.platform.proc_supporting_platform_backend.html">proc_supporting_platform_backend</a><br> |
| <a href="telemetry.core.platform.proc_supporting_platform_backend_unittest.html">proc_supporting_platform_backend_unittest</a><br> |
| </td><td width="25%" valign=top><a href="telemetry.core.platform.profiler.html"><strong>profiler</strong> (package)</a><br> |
| <a href="telemetry.core.platform.ps_util.html">ps_util</a><br> |
| <a href="telemetry.core.platform.win_platform_backend.html">win_platform_backend</a><br> |
| </td></tr></table></td></tr></table><p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ee77aa"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| <td width="100%"><dl> |
| <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> |
| </font></dt><dd> |
| <dl> |
| <dt><font face="helvetica, arial"><a href="telemetry.core.platform.html#Platform">Platform</a> |
| </font></dt></dl> |
| </dd> |
| </dl> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ffc8d8"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#000000" face="helvetica, arial"><a name="Platform">class <strong>Platform</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| |
| <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| <td colspan=2><tt>The platform that the target browser is running on.<br> |
| <br> |
| Provides a limited interface to interact with the platform itself, where<br> |
| possible. It's important to note that platforms may not provide a specific<br> |
| API, so check with IsFooBar() for availability.<br> </tt></td></tr> |
| <tr><td> </td> |
| <td width="100%">Methods defined here:<br> |
| <dl><dt><a name="Platform-CanCaptureVideo"><strong>CanCaptureVideo</strong></a>(self)</dt><dd><tt>Returns a bool indicating whether the platform supports video capture.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-CanFlushIndividualFilesFromSystemCache"><strong>CanFlushIndividualFilesFromSystemCache</strong></a>(self)</dt><dd><tt>Returns true if the disk cache can be flushed for specific files.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-CanLaunchApplication"><strong>CanLaunchApplication</strong></a>(self, application)</dt><dd><tt>Returns whether the platform can launch the given application.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-CanMonitorPowerAsync"><strong>CanMonitorPowerAsync</strong></a>(self)</dt><dd><tt>Returns True iff power can be monitored asynchronously via<br> |
| <a href="#Platform-StartMonitoringPowerAsync">StartMonitoringPowerAsync</a>() and <a href="#Platform-StopMonitoringPowerAsync">StopMonitoringPowerAsync</a>().</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-CanMonitorPowerSync"><strong>CanMonitorPowerSync</strong></a>(self)</dt><dd><tt>Returns True iff power can be monitored synchronously via<br> |
| <a href="#Platform-MonitorPowerSync">MonitorPowerSync</a>().</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-CanMonitorThermalThrottling"><strong>CanMonitorThermalThrottling</strong></a>(self)</dt><dd><tt>Platforms may be able to detect thermal throttling.<br> |
| <br> |
| Some fan-less computers go into a reduced performance mode when their heat<br> |
| exceeds a certain threshold. Performance tests in particular should use this<br> |
| API to detect if this has happened and interpret results accordingly.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-FlushEntireSystemCache"><strong>FlushEntireSystemCache</strong></a>(self)</dt><dd><tt>Flushes the OS's file cache completely.<br> |
| <br> |
| This function may require root or administrator access.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-FlushSystemCacheForDirectory"><strong>FlushSystemCacheForDirectory</strong></a>(self, directory, ignoring<font color="#909090">=None</font>)</dt><dd><tt>Flushes the OS's file cache for the specified directory.<br> |
| <br> |
| Any files or directories inside |directory| matching a name in the<br> |
| |ignoring| list will be skipped.<br> |
| <br> |
| This function does not require root or administrator access.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-GetOSName"><strong>GetOSName</strong></a>(self)</dt><dd><tt>Returns a string description of the <a href="#Platform">Platform</a> OS.<br> |
| <br> |
| Examples: WIN, MAC, LINUX, CHROMEOS</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-GetOSVersionName"><strong>GetOSVersionName</strong></a>(self)</dt><dd><tt>Returns a logically sortable, string-like description of the <a href="#Platform">Platform</a> OS<br> |
| version.<br> |
| <br> |
| Examples: VISTA, WIN7, LION, MOUNTAINLION</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-GetRawDisplayFrameRateMeasurements"><strong>GetRawDisplayFrameRateMeasurements</strong></a>(self)</dt><dd><tt>Returns a list of RawDisplayFrameRateMeasurement.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-HasBeenThermallyThrottled"><strong>HasBeenThermallyThrottled</strong></a>(self)</dt><dd><tt>Returns True if the device has been thermally throttled.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-InstallApplication"><strong>InstallApplication</strong></a>(self, application)</dt><dd><tt>Installs the given application.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-IsApplicationRunning"><strong>IsApplicationRunning</strong></a>(self, application)</dt><dd><tt>Returns whether an application is currently running.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-IsRawDisplayFrameRateSupported"><strong>IsRawDisplayFrameRateSupported</strong></a>(self)</dt><dd><tt>Platforms may be able to collect GL surface stats.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-IsThermallyThrottled"><strong>IsThermallyThrottled</strong></a>(self)</dt><dd><tt>Returns True if the device is currently thermally throttled.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-LaunchApplication"><strong>LaunchApplication</strong></a>(self, application, parameters<font color="#909090">=None</font>, elevate_privilege<font color="#909090">=False</font>)</dt><dd><tt>"Launches the given |application| with a list of |parameters| on the OS.<br> |
| <br> |
| Set |elevate_privilege| to launch the application with root or admin rights.<br> |
| <br> |
| Returns:<br> |
| A popen style process handle for host platforms.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-MonitorPowerSync"><strong>MonitorPowerSync</strong></a>(self, duration_ms)</dt><dd><tt>Synchronously monitors power for |duration_ms|.<br> |
| <br> |
| Returns:<br> |
| A dict of power utilization statistics containing: {<br> |
| # The instantaneous power (voltage * current) reading in milliwatts at<br> |
| # each sample.<br> |
| 'power_samples_mw': [mw0, mw1, ..., mwN],<br> |
| <br> |
| # The total energy consumption during the sampling period in milliwatt<br> |
| # hours. May be estimated by integrating power samples or may be exact<br> |
| # on supported hardware.<br> |
| 'energy_consumption_mwh': mwh,<br> |
| <br> |
| # A platform-specific dictionary of additional details about the<br> |
| # utilization of individual hardware components.<br> |
| hw_component_utilization: {<br> |
| ...<br> |
| }<br> |
| }</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-SetFullPerformanceModeEnabled"><strong>SetFullPerformanceModeEnabled</strong></a>(self, enabled)</dt><dd><tt>Platforms may tweak their CPU governor, system status, etc.<br> |
| <br> |
| Most platforms can operate in a battery saving mode. While good for battery<br> |
| life, this can cause confusing performance results and add noise. Turning<br> |
| full performance mode on disables these features, which is useful for<br> |
| performance testing.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-StartMonitoringPowerAsync"><strong>StartMonitoringPowerAsync</strong></a>(self)</dt><dd><tt>Starts monitoring power utilization statistics.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-StartRawDisplayFrameRateMeasurement"><strong>StartRawDisplayFrameRateMeasurement</strong></a>(self)</dt><dd><tt>Start measuring GL surface stats.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-StartVideoCapture"><strong>StartVideoCapture</strong></a>(self, min_bitrate_mbps)</dt><dd><tt>Starts capturing video.<br> |
| <br> |
| Outer framing may be included (from the OS, browser window, and webcam).<br> |
| <br> |
| Args:<br> |
| min_bitrate_mbps: The minimum capture bitrate in MegaBits Per Second.<br> |
| The platform is free to deliver a higher bitrate if it can do so<br> |
| without increasing overhead.<br> |
| <br> |
| Raises:<br> |
| ValueError if the required |min_bitrate_mbps| can't be achieved.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-StopMonitoringPowerAsync"><strong>StopMonitoringPowerAsync</strong></a>(self)</dt><dd><tt>Stops monitoring power utilization and returns collects stats<br> |
| <br> |
| Returns:<br> |
| A dict of power utilization statistics containing: {<br> |
| # An identifier for the data provider. Allows to evaluate the precision<br> |
| # of the data. Example values: monsoon, powermetrics, ds2784<br> |
| 'identifier': identifier,<br> |
| <br> |
| # The instantaneous power (voltage * current) reading in milliwatts at<br> |
| # each sample.<br> |
| 'power_samples_mw': [mw0, mw1, ..., mwN],<br> |
| <br> |
| # The total energy consumption during the sampling period in milliwatt<br> |
| # hours. May be estimated by integrating power samples or may be exact<br> |
| # on supported hardware.<br> |
| 'energy_consumption_mwh': mwh,<br> |
| <br> |
| # A platform-specific dictionary of additional details about the<br> |
| # utilization of individual hardware components.<br> |
| hw_component_utilization: {<br> |
| ...<br> |
| }<br> |
| }</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-StopRawDisplayFrameRateMeasurement"><strong>StopRawDisplayFrameRateMeasurement</strong></a>(self)</dt><dd><tt>Stop measuring GL surface stats.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-StopVideoCapture"><strong>StopVideoCapture</strong></a>(self)</dt><dd><tt>Stops capturing video.<br> |
| <br> |
| Yields:<br> |
| (time_ms, bitmap) tuples representing each video keyframe. Only the first<br> |
| frame in a run of sequential duplicate bitmaps is included.<br> |
| time_ms is milliseconds relative to the first frame.<br> |
| bitmap is a telemetry.core.Bitmap.</tt></dd></dl> |
| |
| <dl><dt><a name="Platform-__init__"><strong>__init__</strong></a>(self, platform_backend)</dt></dl> |
| |
| <hr> |
| Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| </dl> |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>RawDisplayFrameRateMeasurement</strong> = <class 'telemetry.core.platform.RawDisplayFrameRateMeasurement'></dl> |
| |
| </td></tr></table></td></tr></table> |
| </body></html> |