Class: TestProf::StackProf::Configuration
- Inherits:
-
Object
- Object
- TestProf::StackProf::Configuration
- Defined in:
- lib/test_prof/stack_prof.rb
Overview
StackProf configuration
Constant Summary collapse
- FORMATS =
%w[html json].freeze
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#ignore_gc ⇒ Object
Returns the value of attribute ignore_gc.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #boot? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #raw? ⇒ Boolean
- #suite? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/test_prof/stack_prof.rb', line 28 def initialize @mode = ENV.fetch("TEST_STACK_PROF_MODE", :wall).to_sym @target = (ENV["TEST_STACK_PROF"] == "boot") ? :boot : :suite @raw = ENV["TEST_STACK_PROF_RAW"] != "0" @format = if FORMATS.include?(ENV["TEST_STACK_PROF_FORMAT"]) ENV["TEST_STACK_PROF_FORMAT"] else "json" end sample_interval = ENV["TEST_STACK_PROF_INTERVAL"].to_i @interval = (sample_interval > 0) ? sample_interval : nil @ignore_gc = !ENV["TEST_STACK_PROF_IGNORE_GC"].nil? end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
27 28 29 |
# File 'lib/test_prof/stack_prof.rb', line 27 def format @format end |
#ignore_gc ⇒ Object
Returns the value of attribute ignore_gc.
27 28 29 |
# File 'lib/test_prof/stack_prof.rb', line 27 def ignore_gc @ignore_gc end |
#interval ⇒ Object
Returns the value of attribute interval.
27 28 29 |
# File 'lib/test_prof/stack_prof.rb', line 27 def interval @interval end |
#mode ⇒ Object
Returns the value of attribute mode.
27 28 29 |
# File 'lib/test_prof/stack_prof.rb', line 27 def mode @mode end |
#raw ⇒ Object
Returns the value of attribute raw.
27 28 29 |
# File 'lib/test_prof/stack_prof.rb', line 27 def raw @raw end |
#target ⇒ Object
Returns the value of attribute target.
27 28 29 |
# File 'lib/test_prof/stack_prof.rb', line 27 def target @target end |
Instance Method Details
#boot? ⇒ Boolean
48 49 50 |
# File 'lib/test_prof/stack_prof.rb', line 48 def boot? target == :boot end |
#raw? ⇒ Boolean
44 45 46 |
# File 'lib/test_prof/stack_prof.rb', line 44 def raw? @raw == true end |
#suite? ⇒ Boolean
52 53 54 |
# File 'lib/test_prof/stack_prof.rb', line 52 def suite? target == :suite end |