PHP Class Xhgui_Profiles, xhgui

Afficher le fichier Open project: perftools/xhgui Class Usage Examples

Protected Properties

Свойство Type Description
$_collection
$_mapper

Méthodes publiques

Méthode Description
__construct ( MongoDb $db )
get ( string $id ) : Xhgui_Profile Get a single profile run by id.
getAll ( array $options = [] ) : array Get a paginated set of results.
getAvgsForUrl ( string $url, array $search = [] ) : array Get the Average metrics for a URL
getForUrl ( string $url, array $options, array $conditions = [] ) : MongoCursor Get the list of profiles for a simplified url.
getPercentileForUrl ( integer $percentile, string $url, array $search = [] ) : array Get the Percentile metrics for a URL
insert ( array $profile ) Insert a profile run.
latest ( ) : Xhgui_Profile Get the latest profile data.
paginate ( $options )
query ( $conditions, $fields = null )
truncate ( ) : boolean Used to truncate a collection.

Méthodes protégées

Méthode Description
_wrap ( array | MongoCursor $data ) : Xhgui_Profile | array Converts arrays + MongoCursors into Xhgui_Profile instances.

Method Details

__construct() public méthode

public __construct ( MongoDb $db )
$db MongoDb

_wrap() protected méthode

Converts arrays + MongoCursors into Xhgui_Profile instances.
protected _wrap ( array | MongoCursor $data ) : Xhgui_Profile | array
$data array | MongoCursor The data to transform.
Résultat Xhgui_Profile | array The transformed/wrapped results.

get() public méthode

Get a single profile run by id.
public get ( string $id ) : Xhgui_Profile
$id string The id of the profile to get.
Résultat Xhgui_Profile

getAll() public méthode

Get a paginated set of results.
public getAll ( array $options = [] ) : array
$options array The find options to use.
Résultat array An array of result data.

getAvgsForUrl() public méthode

This will group data by date and returns only the avg + date, making the data ideal for time series graphs
public getAvgsForUrl ( string $url, array $search = [] ) : array
$url string
$search array Search options containing date_start and or date_end
Résultat array Array of metrics grouped by date

getForUrl() public méthode

Get the list of profiles for a simplified url.
public getForUrl ( string $url, array $options, array $conditions = [] ) : MongoCursor
$url string The url to load profiles for.
$options array Pagination options to use.
$conditions array The search options.
Résultat MongoCursor

getPercentileForUrl() public méthode

This will group data by date and returns only the percentile + date, making the data ideal for time series graphs
public getPercentileForUrl ( integer $percentile, string $url, array $search = [] ) : array
$percentile integer The percentile you want. e.g. 90.
$url string
$search array Search options containing date_start and or date_end
Résultat array Array of metrics grouped by date

insert() public méthode

Does unchecked inserts.
public insert ( array $profile )
$profile array The profile data to save.

latest() public méthode

Get the latest profile data.
public latest ( ) : Xhgui_Profile
Résultat Xhgui_Profile

paginate() public méthode

public paginate ( $options )

query() public méthode

public query ( $conditions, $fields = null )

truncate() public méthode

Primarly used in test cases to reset the test db.
public truncate ( ) : boolean
Résultat boolean

Property Details

$_collection protected_oe property

protected $_collection

$_mapper protected_oe property

protected $_mapper