Sha256: 3fc1de1a6d172f4aceb09405f294b8be265f931c74e6f8301f7a6cfb9a56605f

Contents?: true

Size: 703 Bytes

Versions: 21

Compression:

Stored size: 703 Bytes

Contents

#!/usr/bin/env ruby

require 'redis'

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

events = []

events << {
  'entity'    => "app-#{id}",
  'check'     => 'http',
  'type'      => 'service',
  'state'     => 'critical',
  'summary'   => "It's failing, yo!",
  'timestamp' => Time.now.to_i,
}.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

21 entries across 21 versions & 1 rubygems

Version Path
flapjack-1.6.0 tmp/create_events_failure.rb
flapjack-1.6.0rc4 tmp/create_events_failure.rb
flapjack-1.6.0rc3 tmp/create_events_failure.rb
flapjack-1.6.0rc2 tmp/create_events_failure.rb
flapjack-1.6.0rc1 tmp/create_events_failure.rb
flapjack-1.5.0 tmp/create_events_failure.rb
flapjack-1.5.0rc1 tmp/create_events_failure.rb
flapjack-1.4.0 tmp/create_events_failure.rb
flapjack-1.4.0rc1 tmp/create_events_failure.rb
flapjack-1.3.0 tmp/create_events_failure.rb
flapjack-1.3.0rc3 tmp/create_events_failure.rb
flapjack-1.3.0rc2 tmp/create_events_failure.rb
flapjack-1.3.0rc1 tmp/create_events_failure.rb
flapjack-1.2.2 tmp/create_events_failure.rb
flapjack-1.2.1 tmp/create_events_failure.rb
flapjack-1.2.1rc3 tmp/create_events_failure.rb
flapjack-1.2.1rc2 tmp/create_events_failure.rb
flapjack-1.2.1rc1 tmp/create_events_failure.rb
flapjack-1.2.0 tmp/create_events_failure.rb
flapjack-1.2.0rc2 tmp/create_events_failure.rb