Reset op_sec_last_sample_ops when reset requested

This value needs to be set to zero (in addition to
stat_numcommands) or else people may see
a negative operations per second count after they
run CONFIG RESETSTAT.

Fixes antirez/redis#1577
This commit is contained in:
Matt Stancliff 2014-03-04 17:31:34 -05:00 committed by antirez
parent 385c25f70f
commit e8bae92e54

View File

@ -1810,6 +1810,7 @@ void configCommand(redisClient *c) {
server.stat_keyspace_hits = 0; server.stat_keyspace_hits = 0;
server.stat_keyspace_misses = 0; server.stat_keyspace_misses = 0;
server.stat_numcommands = 0; server.stat_numcommands = 0;
server.ops_sec_last_sample_ops = 0;
server.stat_numconnections = 0; server.stat_numconnections = 0;
server.stat_expiredkeys = 0; server.stat_expiredkeys = 0;
server.stat_rejected_conn = 0; server.stat_rejected_conn = 0;