Class: Instrumentality::Profile::Benchmark

Inherits:
Instrumentality::Profile show all
Defined in:
lib/instrumentality/command/profile/benchmark.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Instrumentality::Profile

shared_arguments, shared_options, #validate_shared_arguments!

Constructor Details

#initialize(argv) ⇒ Benchmark

Returns a new instance of Benchmark.



23
24
25
26
# File 'lib/instrumentality/command/profile/benchmark.rb', line 23

def initialize(argv)
  @experimental = argv.flag?('experimental', false)
  super
end

Class Method Details

.optionsObject



10
11
12
13
14
# File 'lib/instrumentality/command/profile/benchmark.rb', line 10

def self.options
  shared_options.concat([
    ['--experimental', "Don't use it if you don't know what it does"],
  ]).concat(super)
end

Instance Method Details

#runObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/instrumentality/command/profile/benchmark.rb', line 33

def run
  config = OpenStruct.new({'script' => Constants::BENCHMARK_SCRIPT,
                           'process' => @process,
                           'workspace' => @workspace,
                           'project' => @project,
                           'scheme' => @scheme,
                           'server_port' => @server_port,
                           'interactive' => @interactive,
                           'experimental' => @experimental})
  profiler = Profiler.new(config, @verbose)
  profiler.profile
end

#validate!Object



28
29
30
31
# File 'lib/instrumentality/command/profile/benchmark.rb', line 28

def validate!
  super
  validate_shared_arguments!
end