PHP Класс 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
Автор: Kannan
Автор: Paul Reinheimer (http://blog.preinheimer.com)
Наследование: implements iXHProfRuns
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$prefix
$run_details

Защищенные свойства (Protected)

Свойство Тип Описание
$db Db_Abstract

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
calculatePercentile ( $details )
db ( )

Приватные методы

Метод Описание
gen_run_id ( $type ) When setting the id column, consider the length of the prefix you're specifying in $this->prefix

Описание методов

__construct() публичный Метод

public __construct ( $dir = null )

calculatePercentile() защищенный Метод

protected calculatePercentile ( $details )

db() защищенный Метод

protected db ( )

getDbClass() публичный статический Метод

public static getDbClass ( )

getDistinct() публичный Метод

public getDistinct ( $data )

getHardHit() публичный Метод

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
Результат resource The result set reprsenting the results of the query

getNextAssoc() публичный статический Метод

public static getNextAssoc ( $resultSet )

getRunComparativeData() публичный Метод

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
Результат array

getRuns() публичный Метод

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
Результат resource

getUrlStats() публичный Метод

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.
Результат resource result set from the database query

get_run() публичный Метод

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
Результат mixed

save_run() публичный Метод

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
Результат string

Описание свойств

$db защищенное свойство

protected Db_Abstract $db
Результат Db_Abstract

$prefix публичное свойство

public $prefix

$run_details публичное свойство

public $run_details