telemetry.core.util | index telemetry/core/util.py

`# Copyright 2012 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
`` |  |

telemetry.core.exceptions glob imp | inspect logging os | socket sys time |

Classes
`` |  |

__builtin__.object
  PortKeeper

class PortKeeper(__builtin__.object)
`` | `Port keeper hold an available port on the system. Before actually use the port, you must call Release().`
| Methods defined here:

Release(self)

__init__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

port

Functions
`` |  |

GetBaseDir()

GetBuildDirectories()
  `Yields all combination of Chromium build output directories.`

GetChromiumSrcDir()

GetPythonPageSetModule(file_path)

GetSequentialFileName(base_name)
  `Returns the next sequential file name based on |base_name| and the
  existing files. base_name should not contain extension.
  e.g: if base_name is /tmp/test, and /tmp/test_000.json,
  /tmp/test_001.mp3 exist, this returns /tmp/test_002. In case no
  other sequential file name exist, this will return /tmp/test_000`

GetTelemetryDir()

GetTelemetryThirdPartyDir()

GetUnittestDataDir()

GetUnreservedAvailableLocalPort()
  `Returns an available port on the system.
  WARNING: This method does not reserve the port it returns, so it may be used
  by something else before you get to use it. This can lead to flake.`

IsRunningOnCrosDevice()
  `Returns True if we're on a ChromeOS device.`

WaitFor(condition, timeout)
  `Waits for up to |timeout| secs for the function |condition| to return True.
  Polling frequency is (elapsed_time / 10), with a min of .1s and max of 5s.
  Returns:
  Result of |condition| function (if present).`