Created
March 9, 2011 10:27
-
-
Save solars/862000 to your computer and use it in GitHub Desktop.
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
# create availabilities for hotels | |
# each set contains the hotels which have availability | |
# for a particular day (specified by id) / guest-count | |
redis = Redis.new | |
redis.flushall | |
oldmem = redis.info['used_memory'].to_i | |
(1..3000).each do |hotel| | |
puts hotel if hotel % 50 == 0 | |
(1..10).each do |day| | |
for adult in 1..10 | |
redis.sadd "#{day}_#{adult}", hotel.to_i | |
end | |
end | |
end | |
newmem = redis.info['used_memory'].to_i | |
puts 'mem: ' + (newmem-oldmem).to_s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment