You are here

interface ProfilerInterface in XHProf 8

Provides interface to interact with profiler.

Hierarchy

Expanded class hierarchy of ProfilerInterface

All classes that implement ProfilerInterface

3 files declare their use of ProfilerInterface
RunConverter.php in src/Routing/RunConverter.php
XHProfDataCollector.php in src/DataCollector/XHProfDataCollector.php
XHProfEventSubscriber.php in src/EventSubscriber/XHProfEventSubscriber.php

File

src/ProfilerInterface.php, line 10

Namespace

Drupal\xhprof
View source
interface ProfilerInterface {

  /**
   * Conditionally enable XHProf profiling.
   */
  public function enable();

  /**
   * Shutdown and disable XHProf profiling.
   *
   * Report is saved with selected storage.
   *
   * @return string
   *   The run ID.
   */
  public function shutdown($runId);

  /**
   * Check whether profiler is enabled.
   *
   * @return boolean
   *   TRUE when enabled, FALSE otherwise.
   */
  public function isEnabled();

  /**
   * Returns whether a profiling can be enabled for the current request.
   *
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   The request.
   *
   * @return bool
   *   TRUE profiling can be enabled, FALSE otherwise.
   */
  public function canEnable(Request $request);

  /**
   * Is any profiler extension loaded.
   *
   * @return bool
   *   TRUE when more then one PHP supported profiler enabled, FALSE otherwise.
   */
  public function isLoaded();

  /**
   * Returns a list of available PHP extensions for profiling.
   *
   * @return array
   *   Keyed array of extension name and its description.
   */
  public function getExtensions();

  /**
   * Generates a link to the report page for a specific run ID.
   *
   * @param string $run_id
   *   The run ID.
   *
   * @return string
   *   The rendered link.
   */
  public function link($run_id);

  /**
   * Returns the current selected storage.
   *
   * @return \Drupal\xhprof\XHProfLib\Storage\StorageInterface
   *   The storage.
   */
  public function getStorage();

  /**
   * Returns the run id associated with the current request.
   *
   * @return string
   *   The run ID.
   */
  public function getRunId();

  /**
   * Creates a new unique run id.
   *
   * @return string
   *   The run ID.
   */
  public function createRunId();

  /**
   * Loads a specific run.
   *
   * @param string $run_id
   *   The run ID.
   *
   * @return \Drupal\xhprof\XHProfLib\Run
   *   The run object.
   */
  public function getRun($run_id);

}

Members

Namesort descending Modifiers Type Description Overrides
ProfilerInterface::canEnable public function Returns whether a profiling can be enabled for the current request. 1
ProfilerInterface::createRunId public function Creates a new unique run id. 1
ProfilerInterface::enable public function Conditionally enable XHProf profiling. 1
ProfilerInterface::getExtensions public function Returns a list of available PHP extensions for profiling. 1
ProfilerInterface::getRun public function Loads a specific run. 1
ProfilerInterface::getRunId public function Returns the run id associated with the current request. 1
ProfilerInterface::getStorage public function Returns the current selected storage. 1
ProfilerInterface::isEnabled public function Check whether profiler is enabled. 1
ProfilerInterface::isLoaded public function Is any profiler extension loaded. 1
ProfilerInterface::link public function Generates a link to the report page for a specific run ID. 1
ProfilerInterface::shutdown public function Shutdown and disable XHProf profiling. 1