Class: FacterStatistax::Executors::TestRunExecutor
- Inherits:
-
Object
- Object
- FacterStatistax::Executors::TestRunExecutor
- Defined in:
- lib/executors/test_run_executor.rb
Instance Attribute Summary collapse
-
#fact ⇒ Object
readonly
Returns the value of attribute fact.
-
#repetitions ⇒ Object
readonly
Returns the value of attribute repetitions.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(run) ⇒ TestRunExecutor
constructor
A new instance of TestRunExecutor.
Constructor Details
#initialize(run) ⇒ TestRunExecutor
Returns a new instance of TestRunExecutor.
6 7 8 9 |
# File 'lib/executors/test_run_executor.rb', line 6 def initialize(run) @fact = run.fact @repetitions = run.repetitions end |
Instance Attribute Details
#fact ⇒ Object (readonly)
Returns the value of attribute fact.
11 12 13 |
# File 'lib/executors/test_run_executor.rb', line 11 def fact @fact end |
#repetitions ⇒ Object (readonly)
Returns the value of attribute repetitions.
11 12 13 |
# File 'lib/executors/test_run_executor.rb', line 11 def repetitions @repetitions end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/executors/test_run_executor.rb', line 13 def execute sum = sum_for_each_repetition do time, _status = Open3.capture2("ruby #{SCRIPTS_DIR}/benchmark_script.rb #{IS_GEM} #{fact}") log_time(fact, time) time.to_f end Common::OutputWriter.instance.write_run(fact, sum / repetitions) end |