Sha256: 35c763cec1c315a87a05f9d6bb72588d22862590395f6212534671029e56e531

Contents?: true

Size: 935 Bytes

Versions: 24

Compression:

Stored size: 935 Bytes

Contents

module DeepTest
  module Distributed
    class ThroughputRunner
      def initialize(options, test_count, blackboard = nil, &block)
        @options = options
        @test_count = test_count
        @blackboard = blackboard
        @progress_block = block
      end

      def blackboard
        @blackboard ||= @options.server
      end

      def statistics
        ThroughputStatistics.new(@test_count, @start_time, @end_time)
      end

      def process_work_units
        @start_time = Time.now

        @test_count.times do
          blackboard.write_work NullWorkUnit.new
        end
 
        results_read = 0
        until results_read == @test_count
          Thread.pass
          result = blackboard.take_result
          if result
            results_read += 1 
            @progress_block.call(result) if @progress_block
          end
        end

        @end_time = Time.now

        true
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 4 rubygems

Version Path
jason-o-matic-deep_test-1.2.2.1 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.10 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.11 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.12 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.13 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.14 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.2 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.3 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.4 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.5 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.6 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.7 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.8 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.9 lib/deep_test/distributed/throughput_runner.rb
jperkins-deep_test-1.2.2 lib/deep_test/distributed/throughput_runner.rb
jason-o-matic-deep_test-1.2.2.15 lib/deep_test/distributed/throughput_runner.rb
jstorimer-deep-test-1.4.0 lib/deep_test/distributed/throughput_runner.rb
jstorimer-deep-test-1.3.0 lib/deep_test/distributed/throughput_runner.rb
jstorimer-deep-test-1.2.0 lib/deep_test/distributed/throughput_runner.rb
jstorimer-deep-test-1.1.0 lib/deep_test/distributed/throughput_runner.rb