Sha256: 8c9ab804e32f87c7b8f7c07fb94d6272355ad2f42068b9c1bee722a18878a47c

Contents?: true

Size: 650 Bytes

Versions: 27

Compression:

Stored size: 650 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(: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

27 entries across 27 versions & 1 rubygems

Version Path
flapjack-0.6.60 tmp/create_events_ok.rb
flapjack-0.6.59 tmp/create_events_ok.rb
flapjack-0.6.58 tmp/create_events_ok.rb
flapjack-0.6.57 tmp/create_events_ok.rb
flapjack-0.6.56 tmp/create_events_ok.rb
flapjack-0.6.55 tmp/create_events_ok.rb
flapjack-0.6.54 tmp/create_events_ok.rb