Sha256: 81e6665603d4710a9370177e3c9d48352cbcdb4da128d3ce1b16e16b10056df9
Contents?: true
Size: 613 Bytes
Versions: 21
Compression:
Stored size: 613 Bytes
Contents
#!/usr/bin/env ruby require 'redis' #id = "%.2d" % (1..10).to_a[rand(9)] events = [] events << { 'entity' => "client1-localhost-test-1", 'check' => 'foo', 'type' => 'service', 'state' => 'ok', }.to_json redis = Redis.new(:db => 13) events.each {|event| redis.rpush 'events', event } 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