Skip to content

Instantly share code, notes, and snippets.

@drob
Created February 24, 2014 02:10
Show Gist options
  • Save drob/9180760 to your computer and use it in GitHub Desktop.
Save drob/9180760 to your computer and use it in GitHub Desktop.
#!/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