You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
test.js: slowlog. Closes #295
Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
This commit is contained in:
15
test.js
15
test.js
@@ -1586,6 +1586,21 @@ tests.ENABLE_OFFLINE_QUEUE_FALSE = function () {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tests.SLOWLOG = function () {
|
||||||
|
var name = "SLOWLOG";
|
||||||
|
client.slowlog('reset',require_string("OK", name));
|
||||||
|
client.config('set', 'slowlog-log-slower-than', 0,require_string("OK", name));
|
||||||
|
client.set('foo','bar',require_string("OK", name));
|
||||||
|
client.get('foo',require_string("bar", name));
|
||||||
|
client.slowlog('get',function(err,res){
|
||||||
|
assert.equal(res.length, 4, name);
|
||||||
|
assert.equal(res[0][3].length, 2, name);
|
||||||
|
assert.deepEqual(res[1][3], ['set', 'foo', 'bar'], name);
|
||||||
|
assert.deepEqual(res[3][3], ['slowlog', 'reset'], name);
|
||||||
|
next(name);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// TODO - need a better way to test auth, maybe auto-config a local Redis server or something.
|
// TODO - need a better way to test auth, maybe auto-config a local Redis server or something.
|
||||||
// Yes, this is the real password. Please be nice, thanks.
|
// Yes, this is the real password. Please be nice, thanks.
|
||||||
tests.auth = function () {
|
tests.auth = function () {
|
||||||
|
Reference in New Issue
Block a user