Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save antirez/268739 to your computer and use it in GitHub Desktop.
Save antirez/268739 to your computer and use it in GitHub Desktop.
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