Skip to content

Commit

Permalink
Added resetStat function
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Jul 8, 2011
1 parent c9a6ce2 commit 26cf871
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.markdown
Expand Up @@ -1383,6 +1383,7 @@ None.
<pre> <pre>
$redis->bgSave(); $redis->bgSave();
</pre> </pre>

## lastSave ## lastSave


##### *Description* ##### *Description*
Expand Down Expand Up @@ -1622,6 +1623,30 @@ None.
$redis->info(); $redis->info();
</pre> </pre>


## resetStat
##### *Description*
Resets the statistics reported by Redis using the INFO command (`info()` function).

These are the counters that are reset:

* Keyspace hits
* Keyspace misses
* Number of commands processed
* Number of connections received
* Number of expired keys


##### *Parameters*
None.

##### *Return value*
*BOOL*: `TRUE` in case of success, `FALSE` in case of failure.

##### *Example*
<pre>
$redis->resetStat();
</pre>

## ttl ## ttl
##### *Description* ##### *Description*
Returns the time to live left for a given key, in seconds. If the key doesn't exist, `FALSE` is returned. Returns the time to live left for a given key, in seconds. If the key doesn't exist, `FALSE` is returned.
Expand Down
1 change: 1 addition & 0 deletions php_redis.h
Expand Up @@ -96,6 +96,7 @@ PHP_METHOD(Redis, auth);
PHP_METHOD(Redis, ttl); PHP_METHOD(Redis, ttl);
PHP_METHOD(Redis, persist); PHP_METHOD(Redis, persist);
PHP_METHOD(Redis, info); PHP_METHOD(Redis, info);
PHP_METHOD(Redis, resetStat);
PHP_METHOD(Redis, select); PHP_METHOD(Redis, select);
PHP_METHOD(Redis, move); PHP_METHOD(Redis, move);
PHP_METHOD(Redis, zAdd); PHP_METHOD(Redis, zAdd);
Expand Down
11 changes: 11 additions & 0 deletions redis.c
Expand Up @@ -124,6 +124,7 @@ static zend_function_entry redis_functions[] = {
PHP_ME(Redis, ttl, NULL, ZEND_ACC_PUBLIC) PHP_ME(Redis, ttl, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, persist, NULL, ZEND_ACC_PUBLIC) PHP_ME(Redis, persist, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, info, NULL, ZEND_ACC_PUBLIC) PHP_ME(Redis, info, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, resetStat, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, select, NULL, ZEND_ACC_PUBLIC) PHP_ME(Redis, select, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, move, NULL, ZEND_ACC_PUBLIC) PHP_ME(Redis, move, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, bgrewriteaof, NULL, ZEND_ACC_PUBLIC) PHP_ME(Redis, bgrewriteaof, NULL, ZEND_ACC_PUBLIC)
Expand Down Expand Up @@ -2931,6 +2932,16 @@ PHP_METHOD(Redis, info) {
} }
/* }}} */ /* }}} */


/* {{{ proto string Redis::resetStat()
*/
PHP_METHOD(Redis, resetStat)
{
char *cmd;
int cmd_len = redis_cmd_format_static(&cmd, "CONFIG", "s", "RESETSTAT", 9);
generic_empty_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, cmd, cmd_len);
}
/* }}} */

/* {{{ proto bool Redis::select(long dbNumber) /* {{{ proto bool Redis::select(long dbNumber)
*/ */
PHP_METHOD(Redis, select) { PHP_METHOD(Redis, select) {
Expand Down

0 comments on commit 26cf871

Please sign in to comment.