Class: TestProf::TPSProf::Configuration
- Inherits:
-
Object
- Object
- TestProf::TPSProf::Configuration
- Defined in:
- lib/test_prof/tps_prof.rb
Instance Attribute Summary collapse
-
#custom_strict_handler ⇒ Object
readonly
Returns the value of attribute custom_strict_handler.
-
#max_examples_count ⇒ Object
Thresholds.
-
#max_group_time ⇒ Object
Thresholds.
-
#min_examples_count ⇒ Object
Thresholds.
-
#min_group_time ⇒ Object
Thresholds.
-
#min_target_tps ⇒ Object
Thresholds.
-
#min_tps ⇒ Object
Thresholds.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#reporter ⇒ Object
Returns the value of attribute reporter.
-
#top_count ⇒ Object
Returns the value of attribute top_count.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #strict_handler ⇒ Object
- #strict_handler=(val) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/test_prof/tps_prof.rb', line 37 def initialize @mode = (ENV["TPS_PROF_MODE"] || ((ENV["TPS_PROF"] == "strict") ? :strict : :profile)).to_sym @top_count = ENV["TPS_PROF_COUNT"]&.to_i || ((ENV["TPS_PROF"].to_i > 1) ? ENV["TPS_PROF"].to_i : nil) || 10 @min_examples_count = ENV.fetch("TPS_PROF_MIN_EXAMPLES", 10).to_i @min_group_time = ENV.fetch("TPS_PROF_MIN_TIME", 5).to_i @min_target_tps = ENV.fetch("TPS_PROF_TARGET_TPS", 30).to_i @max_examples_count = ENV["TPS_PROF_MAX_EXAMPLES"]&.to_i @max_group_time = ENV["TPS_PROF_MAX_TIME"]&.to_i @min_tps = ENV["TPS_PROF_MIN_TPS"]&.to_i @reporter = resolve_reporter(ENV["TPS_PROF_FORMAT"]) end |
Instance Attribute Details
#custom_strict_handler ⇒ Object (readonly)
Returns the value of attribute custom_strict_handler.
35 36 37 |
# File 'lib/test_prof/tps_prof.rb', line 35 def custom_strict_handler @custom_strict_handler end |
#max_examples_count ⇒ Object
Thresholds
26 27 28 |
# File 'lib/test_prof/tps_prof.rb', line 26 def max_examples_count @max_examples_count end |
#max_group_time ⇒ Object
Thresholds
26 27 28 |
# File 'lib/test_prof/tps_prof.rb', line 26 def max_group_time @max_group_time end |
#min_examples_count ⇒ Object
Thresholds
26 27 28 |
# File 'lib/test_prof/tps_prof.rb', line 26 def min_examples_count @min_examples_count end |
#min_group_time ⇒ Object
Thresholds
26 27 28 |
# File 'lib/test_prof/tps_prof.rb', line 26 def min_group_time @min_group_time end |
#min_target_tps ⇒ Object
Thresholds
26 27 28 |
# File 'lib/test_prof/tps_prof.rb', line 26 def min_target_tps @min_target_tps end |
#min_tps ⇒ Object
Thresholds
26 27 28 |
# File 'lib/test_prof/tps_prof.rb', line 26 def min_tps @min_tps end |
#mode ⇒ Object
Returns the value of attribute mode.
23 24 25 |
# File 'lib/test_prof/tps_prof.rb', line 23 def mode @mode end |
#reporter ⇒ Object
Returns the value of attribute reporter.
23 24 25 |
# File 'lib/test_prof/tps_prof.rb', line 23 def reporter @reporter end |
#top_count ⇒ Object
Returns the value of attribute top_count.
23 24 25 |
# File 'lib/test_prof/tps_prof.rb', line 23 def top_count @top_count end |
Instance Method Details
#strict_handler ⇒ Object
52 53 54 |
# File 'lib/test_prof/tps_prof.rb', line 52 def strict_handler @strict_handler ||= method(:default_strict_handler) end |
#strict_handler=(val) ⇒ Object
56 57 58 59 |
# File 'lib/test_prof/tps_prof.rb', line 56 def strict_handler=(val) @strict_handler = val @custom_strict_handler = true end |