Created
January 3, 2017 19:45
-
-
Save postazure/d8d05c83fa6d7b2a274945d9057023dc to your computer and use it in GitHub Desktop.
Fill Redis Database with Junk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "redis" | |
require "securerandom" | |
if ARGV.length != 4 | |
puts "redis-filler.rb password url port mb" | |
exit 1 | |
end | |
password = ARGV[0] | |
url = ARGV[1] | |
port = ARGV[2] | |
mb_to_load = ARGV[3].to_i | |
redis = Redis.new(:url => "redis://:#{password}@#{url}:#{port}") | |
mb_to_load.times do | |
1024.times do | |
redis.set("setby-script:#{SecureRandom.uuid}", SecureRandom.random_bytes(1024)) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment