Sha256: 2f9cc0633b777a50a03970be355c302d5fc85ee3f250b7344cfe69763ac85f54

Contents?: true

Size: 639 Bytes

Versions: 31

Compression:

Stored size: 639 Bytes

Contents

#!/usr/bin/env ruby

require 'redis'
require 'json'

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

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

31 entries across 31 versions & 1 rubygems

Version Path
flapjack-0.6.53 tmp/create_events_ok.rb
flapjack-0.6.52 tmp/create_events_ok.rb
flapjack-0.6.51 tmp/create_events_ok.rb
flapjack-0.6.50 tmp/create_events_ok.rb
flapjack-0.6.49 tmp/create_events_ok.rb
flapjack-0.6.48 tmp/create_events_ok.rb
flapjack-0.6.47 tmp/create_events_ok.rb
flapjack-0.6.46 tmp/create_events_ok.rb
flapjack-0.6.45 tmp/create_events_ok.rb
flapjack-0.6.44 tmp/create_events_ok.rb
flapjack-0.6.43 tmp/create_events_ok.rb
flapjack-0.6.42 tmp/create_events_ok.rb
flapjack-0.6.41 tmp/create_events_ok.rb
flapjack-0.6.40 tmp/create_events_ok.rb
flapjack-0.6.39 tmp/create_events_ok.rb
flapjack-0.6.38 tmp/create_events_ok.rb
flapjack-0.6.37 tmp/create_events_ok.rb
flapjack-0.6.36 tmp/create_events_ok.rb
flapjack-0.6.35 tmp/create_events_ok.rb
flapjack-0.6.34 tmp/create_events_ok.rb