Class: TestProf::FactoryProf::Configuration
- Inherits:
-
Object
- Object
- TestProf::FactoryProf::Configuration
- Defined in:
- lib/test_prof/factory_prof.rb
Overview
FactoryProf configuration
Instance Attribute Summary collapse
-
#include_variations ⇒ Object
Returns the value of attribute include_variations.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#printer ⇒ Object
Returns the value of attribute printer.
-
#threshold ⇒ Object
Returns the value of attribute threshold.
-
#truncate_names ⇒ Object
Returns the value of attribute truncate_names.
-
#variations_limit ⇒ Object
Returns the value of attribute variations_limit.
Instance Method Summary collapse
-
#flamegraph? ⇒ Boolean
Whether we want to generate flamegraphs.
- #include_variations? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/test_prof/factory_prof.rb', line 22 def initialize @mode = (ENV["FPROF"] == "flamegraph") ? :flamegraph : :simple @printer = case ENV["FPROF"] when "flamegraph" Printers::Flamegraph when "nate_heckler" Printers::NateHeckler when "json" Printers::Json else Printers::Simple end @threshold = ENV.fetch("FPROF_THRESHOLD", 0).to_i @include_variations = ENV["FPROF_VARS"] == "1" @variations_limit = ENV.fetch("FPROF_VARIATIONS_LIMIT", 2).to_i @truncate_names = ENV["FPROF_TRUNCATE_NAMES"] == "1" end |
Instance Attribute Details
#include_variations ⇒ Object
Returns the value of attribute include_variations.
19 20 21 |
# File 'lib/test_prof/factory_prof.rb', line 19 def include_variations @include_variations end |
#mode ⇒ Object
Returns the value of attribute mode.
19 20 21 |
# File 'lib/test_prof/factory_prof.rb', line 19 def mode @mode end |
#printer ⇒ Object
Returns the value of attribute printer.
19 20 21 |
# File 'lib/test_prof/factory_prof.rb', line 19 def printer @printer end |
#threshold ⇒ Object
Returns the value of attribute threshold.
19 20 21 |
# File 'lib/test_prof/factory_prof.rb', line 19 def threshold @threshold end |
#truncate_names ⇒ Object
Returns the value of attribute truncate_names.
19 20 21 |
# File 'lib/test_prof/factory_prof.rb', line 19 def truncate_names @truncate_names end |
#variations_limit ⇒ Object
Returns the value of attribute variations_limit.
19 20 21 |
# File 'lib/test_prof/factory_prof.rb', line 19 def variations_limit @variations_limit end |
Instance Method Details
#flamegraph? ⇒ Boolean
Whether we want to generate flamegraphs
42 43 44 |
# File 'lib/test_prof/factory_prof.rb', line 42 def flamegraph? @mode == :flamegraph end |
#include_variations? ⇒ Boolean
46 47 48 |
# File 'lib/test_prof/factory_prof.rb', line 46 def include_variations? @include_variations == true end |