Sha256: 94958e1d3f9a170414ba2a5d7ae2802b1f4478abdfa793f3044d7b10c79ed117

Contents?: true

Size: 1.28 KB

Versions: 13

Compression:

Stored size: 1.28 KB

Contents

#
# testing ruote
#
# Wed Sep 16 16:28:36 JST 2009
#

#require 'profile'

require 'rubygems'

require File.dirname(__FILE__) + '/../path_helper'
require File.dirname(__FILE__) + '/../functional/engine_helper'
require 'ruote/log/test_logger'

ac = {
  #:definition_in_launchitem_allowed => true
}

engine = determine_engine_class(ac).new(ac)

#puts
#p engine.class
#puts

#N = 10_000
N = 1_000
#N = 300

engine.add_service(:s_logger, Ruote::TestLogger)
#engine.context[:noisy] = true

launched = nil
reached = nil
count = 0

engine.register_participant :alpha do |workitem|
  reached ||= Time.now
  count += 1
end

launched = Time.now

#wfid = engine.launch(
#  Ruote.process_definition :name => 'ci' do
#    concurrent_iterator :branches => N.to_s do
#      alpha
#    end
#  end
#)
wfid = engine.launch(
  Ruote.process_definition(:name => 'ci') do
    concurrent_iterator :branches => 10 do
      concurrent_iterator :branches => 10 do
        concurrent_iterator :branches => 10 do
          alpha
        end
      end
    end
  end
)

engine.logger.wait_for([ [ :processes, :terminated, { :wfid => wfid } ] ])

puts "whole process took #{Time.now - launched} s"
puts "workitem reached first participant after #{reached - launched} s"
puts "seen #{count} workitems"
puts "#{N} branches"

engine.stop

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
ruote-maestrodev-2.2.1 test/bm/ici.rb
ruote-2.2.0 test/bm/ici.rb
ruote-2.1.11 test/bm/ici.rb
ruote-2.1.10 test/bm/ici.rb
ruote-2.1.9 test/bm/ici.rb
ruote-2.1.8 test/bm/ici.rb
ruote-2.1.7 test/bm/ici.rb
ruote-2.1.6 test/bm/ici.rb
ruote-2.1.5 test/bm/ici.rb
ruote-2.1.4 test/bm/ici.rb
ruote-2.1.3 test/bm/ici.rb
ruote-2.1.2 test/bm/ici.rb
ruote-2.1.1 test/bm/ici.rb