Sha256: 7c0c6c8b7e354570079df755d37c014e3b622b08a70f2de466dff2cb2eb8fea4

Contents?: true

Size: 1.02 KB

Versions: 42

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/env ruby

require 'redis'

require 'oj'
Oj.default_options = { :indent => 0, :mode => :strict }

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

42 entries across 42 versions & 1 rubygems

Version Path
flapjack-0.8.6 tmp/create_events_ok_failure_ack.rb
flapjack-0.8.5 tmp/create_events_ok_failure_ack.rb
flapjack-0.8.4 tmp/create_events_ok_failure_ack.rb
flapjack-0.8.3 tmp/create_events_ok_failure_ack.rb
flapjack-0.8.2 tmp/create_events_ok_failure_ack.rb
flapjack-0.8.1 tmp/create_events_ok_failure_ack.rb
flapjack-0.8.0 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.35 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.34 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.33 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.32 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.31 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.30 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.29 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.28 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.27 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.26 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.25 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.22 tmp/create_events_ok_failure_ack.rb
flapjack-0.7.21 tmp/create_events_ok_failure_ack.rb