Sha256: 43764470c460651e98fca667d5e8366ace0914bb464636bac1b3ebf6fd293869

Contents?: true

Size: 705 Bytes

Versions: 42

Compression:

Stored size: 705 Bytes

Contents

#!/usr/bin/env ruby

require 'redis'

require 'oj'
Oj.default_options = { :indent => 0, :mode => :strict }

id = "%.2d" % (1..10).to_a[rand(9)]

events = []

events << {
  'entity' => "client1-test-app-#{id}",
  'check' => 'http',
  'type' => 'service',
  'state' => 'ok',
}.to_json

redis = Redis.new(:db => 13)

4000.times do
  events.each {|event|
    redis.rpush 'events', event
  }
end

puts "#{Time.now} - finished loading up events"
previous_events_size = redis.llen 'events'
while previous_events_size > 0
  sleep 1
  events_size = redis.llen 'events'
  throughput = previous_events_size - events_size
  previous_events_size = events_size
  puts "#{Time.now} - #{events_size} (#{throughput})"
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
flapjack-0.9.6 tmp/create_events_ok.rb
flapjack-0.9.5 tmp/create_events_ok.rb
flapjack-0.9.4 tmp/create_events_ok.rb
flapjack-1.1.0 tmp/create_events_ok.rb
flapjack-1.0.0 tmp/create_events_ok.rb
flapjack-1.0.0rc6 tmp/create_events_ok.rb
flapjack-1.0.0rc5 tmp/create_events_ok.rb
flapjack-0.9.3 tmp/create_events_ok.rb
flapjack-1.0.0rc3 tmp/create_events_ok.rb
flapjack-1.0.0rc2 tmp/create_events_ok.rb
flapjack-0.9.2 tmp/create_events_ok.rb
flapjack-0.9.1 tmp/create_events_ok.rb
flapjack-1.0.0rc1 tmp/create_events_ok.rb
flapjack-0.9.0 tmp/create_events_ok.rb
flapjack-0.8.12 tmp/create_events_ok.rb
flapjack-0.8.11 tmp/create_events_ok.rb
flapjack-0.8.10 tmp/create_events_ok.rb
flapjack-0.8.9 tmp/create_events_ok.rb
flapjack-0.8.8 tmp/create_events_ok.rb
flapjack-0.8.7 tmp/create_events_ok.rb