Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add slowlog command

  • Loading branch information...
commit d9e436ae9e99d99f28f55d04363e245581dab5c3 1 parent 6a9730f
@mrb mrb authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.