PHP Class XHProfRuns_Default, xhprof

This modified version of the file uses a MySQL backend to store the data, it also stores additional information outside the run itself (beyond simply the run id) to make comparisons and run location easier
Author: Kannan
Author: Paul Reinheimer (http://blog.preinheimer.com)
Inheritance: implements iXHProfRuns
Afficher le fichier Open project: preinheimer/xhprof Class Usage Examples

Méthodes publiques

Свойство Type Description
$prefix
$run_details

Protected Properties

Свойство Type Description
$db Db_Abstract

Méthodes publiques

Méthode Description
__construct ( $dir = null )
getDbClass ( )
getDistinct ( $data )
getHardHit ( array $criteria ) : resource Obtains the pages that have been the hardest hit over the past N days, utalizing the getRuns() method.
getNextAssoc ( $resultSet )
getRunComparativeData ( string $url, string $c_url ) : array Get comparative information for a given URL and c_url, this information will be used to display stats like how many calls a URL has, average, min, max execution time, etc. This information is pushed into the global namespace, which is horribly hacky.
getRuns ( array $stats ) : resource This function gets runs based on passed parameters, column data as key, value as the value. Values are escaped automatically. You may also pass limit, order by, group by, or "where" to add those values, all of which are used as is, no escaping.
getUrlStats ( array $data ) : resource Get stats (pmu, ct, wt) on a url or c_url
get_run ( string $run_id, mixed $type, mixed &$run_desc ) : mixed Retreives a run from the database,
save_run ( string $xhprof_data, mixed $type, string $run_id = null, mixed $xhprof_details = null ) : string Save the run in the database.

Méthodes protégées

Méthode Description
calculatePercentile ( $details )
db ( )

Private Methods

Méthode Description
gen_run_id ( $type ) When setting the id column, consider the length of the prefix you're specifying in $this->prefix

Method Details

__construct() public méthode

public __construct ( $dir = null )

calculatePercentile() protected méthode

protected calculatePercentile ( $details )

db() protected méthode

protected db ( )

getDbClass() public static méthode

public static getDbClass ( )

getDistinct() public méthode

public getDistinct ( $data )

getHardHit() public méthode

Obtains the pages that have been the hardest hit over the past N days, utalizing the getRuns() method.
public getHardHit ( array $criteria ) : resource
$criteria array An associative array containing, at minimum, type, days, and limit
Résultat resource The result set reprsenting the results of the query

getNextAssoc() public static méthode

public static getNextAssoc ( $resultSet )

getRunComparativeData() public méthode

Get comparative information for a given URL and c_url, this information will be used to display stats like how many calls a URL has, average, min, max execution time, etc. This information is pushed into the global namespace, which is horribly hacky.
public getRunComparativeData ( string $url, string $c_url ) : array
$url string
$c_url string
Résultat array

getRuns() public méthode

This function gets runs based on passed parameters, column data as key, value as the value. Values are escaped automatically. You may also pass limit, order by, group by, or "where" to add those values, all of which are used as is, no escaping.
public getRuns ( array $stats ) : resource
$stats array Criteria by which to select columns
Résultat resource

getUrlStats() public méthode

Get stats (pmu, ct, wt) on a url or c_url
public getUrlStats ( array $data ) : resource
$data array An associative array containing the limit you'd like to set for the queyr, as well as either c_url or url for the desired element.
Résultat resource result set from the database query

get_run() public méthode

Retreives a run from the database,
public get_run ( string $run_id, mixed $type, mixed &$run_desc ) : mixed
$run_id string unique identifier for the run being requested
$type mixed
$run_desc mixed
Résultat mixed

save_run() public méthode

Save the run in the database.
public save_run ( string $xhprof_data, mixed $type, string $run_id = null, mixed $xhprof_details = null ) : string
$xhprof_data string
$type mixed
$run_id string
$xhprof_details mixed
Résultat string

Property Details

$db protected_oe property

protected Db_Abstract $db
Résultat Db_Abstract

$prefix public_oe property

public $prefix

$run_details public_oe property

public $run_details