module Tribe::Benchmark::Throughput

Constants

ACTOR_COUNT
COUNTERS
MAX_INCR

Public Class Methods

run() click to toggle source
# File lib/tribe/benchmark/throughput.rb, line 8
def self.run
  ACTOR_COUNT.times do |i|
    actor = Tribe.registry["actor_#{i}"]
    actor.shutdown! if actor
  end

  $start_time = Time.now.utc
  $finished = 0
  $lock = Mutex.new

  ACTOR_COUNT.times do |i|
    MyActor.new(:name => "actor_#{i}")
  end

  COUNTERS.times do |i|
    Tribe.registry["actor_#{rand(ACTOR_COUNT)}"].direct_message!(:do_stuff, MyData.new("data_#{i}"))
  end

  $lock.synchronize do
    puts 'Please wait...'
  end
end
stop() click to toggle source
# File lib/tribe/benchmark/throughput.rb, line 31
def self.stop
end