PHP Class Resque\Helpers\Stats

Author: Michael Haynes ([email protected])
Show file Open project: mjphaynes/php-resque Class Usage Examples

Public Methods

Method Description
clear ( string $stat, string $key = Stats::DEFAULT_KEY ) : boolean Delete a statistic with the given name.
decr ( string $stat, integer $by = 1, string $key = Stats::DEFAULT_KEY ) : boolean Decrement the value of the specified statistic by a certain amount (default is -1)
get ( string $stat, string $key = Stats::DEFAULT_KEY ) : mixed Get the value of the supplied statistic counter for the specified statistic
incr ( string $stat, integer $by = 1, string $key = Stats::DEFAULT_KEY ) : boolean Increment the value of the specified statistic by a certain amount (default is 1)

Method Details

clear() public static method

Delete a statistic with the given name.
public static clear ( string $stat, string $key = Stats::DEFAULT_KEY ) : boolean
$stat string The name of the statistic to delete.
$key string The stat key to use
return boolean True if successful, false if not.

decr() public static method

Decrement the value of the specified statistic by a certain amount (default is -1)
public static decr ( string $stat, integer $by = 1, string $key = Stats::DEFAULT_KEY ) : boolean
$stat string The name of the statistic to decrement.
$by integer The amount to decrement the statistic by.
$key string The stat key to use
return boolean True if successful, false if not.

get() public static method

Get the value of the supplied statistic counter for the specified statistic
public static get ( string $stat, string $key = Stats::DEFAULT_KEY ) : mixed
$stat string The name of the statistic to get the stats for
$key string The stat key to use
return mixed Value of the statistic.

incr() public static method

Increment the value of the specified statistic by a certain amount (default is 1)
public static incr ( string $stat, integer $by = 1, string $key = Stats::DEFAULT_KEY ) : boolean
$stat string The name of the statistic to increment
$by integer The amount to increment the statistic by
$key string The stat key to use
return boolean True if successful, false if not.