Browse files

add slowlog command

  • Loading branch information...
1 parent 6a9730f commit d9e436ae9e99d99f28f55d04363e245581dab5c3 @mrb mrb committed Dec 2, 2011
Showing with 15 additions and 0 deletions.
  1. +9 −0 lib/redis.rb
  2. +6 −0 test/remote_server_control_commands_test.rb
View
9 lib/redis.rb
@@ -428,6 +428,15 @@ def lpop(key)
end
end
+ # Interact with the slowlog (get, len, clear)
+ def slowlog(subcommand, length=nil)
+ synchronize do
+ args = [:slowlog, subcommand]
+ args << length if length
+ @client.call args
+ end
+ end
+
# Get all the members in a set.
def smembers(key)
synchronize do
View
6 test/remote_server_control_commands_test.rb
@@ -80,3 +80,9 @@
assert "OK" == redis.sync
end
end
+
+test "SLOWLOG" do |r|
+ r.slowlog(:reset)
+ result = r.slowlog(:len)
+ assert result == 0
+end

0 comments on commit d9e436a

Please sign in to comment.