Skip to content

Instantly share code, notes, and snippets.

@solars
Created March 9, 2011 07:49
Show Gist options
  • Save solars/861843 to your computer and use it in GitHub Desktop.
Save solars/861843 to your computer and use it in GitHub Desktop.
redis mem usage
require 'rubygems'
require 'redis'
def main(opts={})
r = Redis.new(opts)
um = 0
while true do
newum = r.info['used_memory']
if newum != um && um != 0
diff = newum.to_i-um.to_i
puts "#{um} bytes (#{diff} difference)"
end
um = newum
sleep 1
end
end
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment