Permalink
Browse files

Added resetStat function

  • Loading branch information...
1 parent c9a6ce2 commit 26cf871e4780da845e69db0922177b50f68cd576 @erikdubbelboer erikdubbelboer committed Jul 8, 2011
Showing with 37 additions and 0 deletions.
  1. +25 −0 README.markdown
  2. +1 −0 php_redis.h
  3. +11 −0 redis.c
View
@@ -1383,6 +1383,7 @@ None.
<pre>
$redis->bgSave();
</pre>
+
## lastSave
##### *Description*
@@ -1622,6 +1623,30 @@ None.
$redis->info();
</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
##### *Description*
Returns the time to live left for a given key, in seconds. If the key doesn't exist, `FALSE` is returned.
View
@@ -96,6 +96,7 @@ PHP_METHOD(Redis, auth);
PHP_METHOD(Redis, ttl);
PHP_METHOD(Redis, persist);
PHP_METHOD(Redis, info);
+PHP_METHOD(Redis, resetStat);
PHP_METHOD(Redis, select);
PHP_METHOD(Redis, move);
PHP_METHOD(Redis, zAdd);
View
11 redis.c
@@ -124,6 +124,7 @@ static zend_function_entry redis_functions[] = {
PHP_ME(Redis, ttl, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, persist, 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, move, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Redis, bgrewriteaof, NULL, ZEND_ACC_PUBLIC)
@@ -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)
*/
PHP_METHOD(Redis, select) {

0 comments on commit 26cf871

Please sign in to comment.