Sha256: 5ae9b176acb92e1d41f9b8277e6361fac002bda946eb2132f8cecca4eb5e6573

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

module Stella::Engine
  module Functional
    extend Stella::Engine::Base
    extend self
    
    def run(plan, opts={})
      opts = {
        :hosts        => [],
        :benchmark    => false,
        :repetitions  => 1
      }.merge! opts
      Stella.ld "OPTIONS: #{opts.inspect}"
      Stella.li2 "Hosts: " << opts[:hosts].join(', ') if !opts[:hosts].empty?
      
      client = Stella::Client.new opts[:hosts].first
      client.add_observer(self)
      client.enable_benchmark_mode if opts[:benchmark]
      
      plan.usecases.each_with_index do |uc,i|
        desc = (uc.desc || "Usecase ##{i+1}")
        Stella.li ' %-65s '.att(:reverse).bright % [desc]
        Stella.rescue { client.execute uc }
      end
      
      Drydock::Screen.flush
    end
    
  end
end

__END__


$ stella verify -p examples/basic/plan.rb http://localhost:3114
$ stella load -p examples/basic/plan.rb http://localhost:3114
$ stella remote-load -p examples/basic/plan.rb http://localhost:3114
$ stella remote-verify -p examples/basic/plan.rb http://localhost:3114

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
solutious-stella-0.7.0.001 lib/stella/engine/functional.rb
solutious-stella-0.7.0.002 lib/stella/engine/functional.rb
solutious-stella-0.7.0.003 lib/stella/engine/functional.rb
stella-0.7.0.003 lib/stella/engine/functional.rb
stella-0.7.0.002 lib/stella/engine/functional.rb