Class: Bullshit::TimeCase
- Extended by:
- DSLKit::Constant, DSLKit::DSLAccessor
- Includes:
- EvaluationModule
- Defined in:
- lib/bullshit.rb
Overview
This is a Benchmarking Case that uses a time limit.
Instance Attribute Summary
Attributes inherited from Case
Class Method Summary collapse
Instance Method Summary collapse
-
#evaluation(clock) ⇒ Object
Returns the evaluation for
bullshit_case
with the results of the benchmarking as a String. -
#run ⇒ Object
Check if duration has been set.
Methods included from EvaluationModule
#detect_autocorrelation, #detect_outliers, #histogram, #statistics_table
Methods inherited from Case
#[], autorun_all, #bmethods, each, inherited, #initialize, #longest_name, output_filename, #post_run, #pre_run, run, run_all, run_count, #run_method, #run_once, #setup, sorted_bmethods, #teardown, #to_s, #write_files
Constructor Details
This class inherits a constructor from Bullshit::Case
Class Method Details
.message ⇒ Object
1021 1022 1023 1024 |
# File 'lib/bullshit.rb', line 1021 def "Running '#{self}' for a duration of #{duration} secs/method"\ " (compare_time=#{compare_time}):" end |
Instance Method Details
#evaluation(clock) ⇒ Object
Returns the evaluation for bullshit_case
with the results of the benchmarking as a String.
1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 |
# File 'lib/bullshit.rb', line 1031 def evaluation(clock) clock.repeat == 0 and raise BullshitException, "no measurements were gauged" result = '' result << statistics_table(clock) result << histogram(clock) result << detect_outliers(clock) result << detect_autocorrelation(clock) result << "\n" end |
#run ⇒ Object
Check if duration has been set. If yes call Case#run, otherwise raise a BullshitException exception.
1044 1045 1046 1047 1048 |
# File 'lib/bullshit.rb', line 1044 def run(*) self.class.duration or raise BullshitException, 'duration has to be set' super end |