Created
February 24, 2014 02:10
-
-
Save drob/9180760 to your computer and use it in GitHub Desktop.
This file contains 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 | |
num_events = ARGV[0].to_i | |
@rng = Random.new | |
def rand_id | |
@rng.rand 0...1000 | |
end | |
def rand_data | |
['foo', 'bar', 'baz', 'foobar', 'hello', 'gr8_data', 'yolo'].sample | |
end | |
def rand_event | |
"\"event_id=>#{rand_id},data=>#{rand_data}\"" | |
end | |
hstore_events = (0...num_events).map { rand_event } | |
puts "SELECT dedupe_events('{ #{hstore_events.join ', '} }');" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment