Sha256: 243460e4fa87e1de62785c66e3ce36a9970e9b83819a110d26c84c50d1614e46

Contents?: true

Size: 989 Bytes

Versions: 58

Compression:

Stored size: 989 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' => 'ok',
}.to_json

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

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

#events << {
#  'entity' => "app-#{id}",
#  'check' => 'http',
#  'type' => 'service',
#  'state' => 'ok',
#}.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

58 entries across 58 versions & 1 rubygems

Version Path
flapjack-0.6.40 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.39 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.38 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.37 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.36 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.35 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.34 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.33 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.32 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.31 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.30 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.29 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.28 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.27 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.26 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.25 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.24 tmp/create_events_ok_failure_ack.rb
flapjack-0.6.23 tmp/create_events_ok_failure_ack.rb