Sha256: e7ed15d51c44d2467f2ab4358c3b9faef39569558c5c345935d1d114cbe34a02
Contents?: true
Size: 718 Bytes
Versions: 17
Compression:
Stored size: 718 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', '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
17 entries across 17 versions & 1 rubygems