Sha256: 26f9f961160a0ab686ea089bba1555a9e8ce5c1b6e427074d62ed3887358f91d

Contents?: true

Size: 632 Bytes

Versions: 41

Compression:

Stored size: 632 Bytes

Contents

#!/usr/bin/env ruby

require 'redis'
require 'json'

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

events = []

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

redis = Redis.new

2000.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

41 entries across 41 versions & 1 rubygems

Version Path
flapjack-0.7.1 tmp/create_events_failure.rb
flapjack-0.7.0 tmp/create_events_failure.rb
flapjack-0.6.61 tmp/create_events_failure.rb
flapjack-0.6.60 tmp/create_events_failure.rb
flapjack-0.6.59 tmp/create_events_failure.rb
flapjack-0.6.58 tmp/create_events_failure.rb
flapjack-0.6.57 tmp/create_events_failure.rb
flapjack-0.6.56 tmp/create_events_failure.rb
flapjack-0.6.55 tmp/create_events_failure.rb
flapjack-0.6.54 tmp/create_events_failure.rb
flapjack-0.6.53 tmp/create_events_failure.rb
flapjack-0.6.52 tmp/create_events_failure.rb
flapjack-0.6.51 tmp/create_events_failure.rb
flapjack-0.6.50 tmp/create_events_failure.rb
flapjack-0.6.49 tmp/create_events_failure.rb
flapjack-0.6.48 tmp/create_events_failure.rb
flapjack-0.6.47 tmp/create_events_failure.rb
flapjack-0.6.46 tmp/create_events_failure.rb
flapjack-0.6.45 tmp/create_events_failure.rb
flapjack-0.6.44 tmp/create_events_failure.rb