Class: Expressir::Configuration
- Inherits:
-
Object
- Object
- Expressir::Configuration
- Defined in:
- lib/expressir/config.rb
Instance Attribute Summary collapse
-
#benchmark_enabled ⇒ Object
Returns the value of attribute benchmark_enabled.
-
#benchmark_format ⇒ Object
Returns the value of attribute benchmark_format.
-
#benchmark_ips ⇒ Object
Returns the value of attribute benchmark_ips.
-
#benchmark_iterations ⇒ Object
Returns the value of attribute benchmark_iterations.
-
#benchmark_parallel ⇒ Object
Returns the value of attribute benchmark_parallel.
-
#benchmark_save ⇒ Object
Returns the value of attribute benchmark_save.
-
#benchmark_verbose ⇒ Object
Returns the value of attribute benchmark_verbose.
-
#benchmark_warmup ⇒ Object
Returns the value of attribute benchmark_warmup.
-
#logs ⇒ Object
Returns the value of attribute logs.
Instance Method Summary collapse
-
#benchmark_enabled? ⇒ Boolean
Helper methods for checking benchmark settings.
- #benchmark_ips? ⇒ Boolean
- #benchmark_parallel? ⇒ Boolean
- #benchmark_save? ⇒ Boolean
- #benchmark_verbose? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/expressir/config.rb', line 19 def initialize @logs = %i(error) # Enable benchmarking via environment variable @benchmark_enabled = ENV["EXPRESSIR_BENCHMARK"] == "true" # Use benchmark-ips for detailed statistics @benchmark_ips = ENV["EXPRESSIR_BENCHMARK_IPS"] == "true" # Show verbose output for benchmarking @benchmark_verbose = ENV["EXPRESSIR_BENCHMARK_VERBOSE"] == "true" # Save benchmark results to file @benchmark_save = ENV["EXPRESSIR_BENCHMARK_SAVE"] == "true" # Number of iterations for benchmark-ips @benchmark_iterations = (ENV["EXPRESSIR_BENCHMARK_ITERATIONS"] || "3").to_i # Warmup time for benchmark-ips in seconds @benchmark_warmup = (ENV["EXPRESSIR_BENCHMARK_WARMUP"] || "1").to_i # Enable parallel processing (for future implementation) @benchmark_parallel = ENV["EXPRESSIR_BENCHMARK_PARALLEL"] == "true" # Output format for benchmark results (default, json, csv) @benchmark_format = ENV["EXPRESSIR_BENCHMARK_FORMAT"] || "default" end |
Instance Attribute Details
#benchmark_enabled ⇒ Object
Returns the value of attribute benchmark_enabled.
15 16 17 |
# File 'lib/expressir/config.rb', line 15 def benchmark_enabled @benchmark_enabled end |
#benchmark_format ⇒ Object
Returns the value of attribute benchmark_format.
15 16 17 |
# File 'lib/expressir/config.rb', line 15 def benchmark_format @benchmark_format end |
#benchmark_ips ⇒ Object
Returns the value of attribute benchmark_ips.
15 16 17 |
# File 'lib/expressir/config.rb', line 15 def benchmark_ips @benchmark_ips end |
#benchmark_iterations ⇒ Object
Returns the value of attribute benchmark_iterations.
15 16 17 |
# File 'lib/expressir/config.rb', line 15 def benchmark_iterations @benchmark_iterations end |
#benchmark_parallel ⇒ Object
Returns the value of attribute benchmark_parallel.
15 16 17 |
# File 'lib/expressir/config.rb', line 15 def benchmark_parallel @benchmark_parallel end |
#benchmark_save ⇒ Object
Returns the value of attribute benchmark_save.
15 16 17 |
# File 'lib/expressir/config.rb', line 15 def benchmark_save @benchmark_save end |
#benchmark_verbose ⇒ Object
Returns the value of attribute benchmark_verbose.
15 16 17 |
# File 'lib/expressir/config.rb', line 15 def benchmark_verbose @benchmark_verbose end |
#benchmark_warmup ⇒ Object
Returns the value of attribute benchmark_warmup.
15 16 17 |
# File 'lib/expressir/config.rb', line 15 def benchmark_warmup @benchmark_warmup end |
#logs ⇒ Object
Returns the value of attribute logs.
15 16 17 |
# File 'lib/expressir/config.rb', line 15 def logs @logs end |
Instance Method Details
#benchmark_enabled? ⇒ Boolean
Helper methods for checking benchmark settings
40 41 42 |
# File 'lib/expressir/config.rb', line 40 def benchmark_enabled? @benchmark_enabled end |
#benchmark_ips? ⇒ Boolean
44 45 46 |
# File 'lib/expressir/config.rb', line 44 def benchmark_ips? @benchmark_enabled && @benchmark_ips end |
#benchmark_parallel? ⇒ Boolean
56 57 58 |
# File 'lib/expressir/config.rb', line 56 def benchmark_parallel? @benchmark_enabled && @benchmark_parallel end |
#benchmark_save? ⇒ Boolean
52 53 54 |
# File 'lib/expressir/config.rb', line 52 def benchmark_save? @benchmark_enabled && @benchmark_save end |
#benchmark_verbose? ⇒ Boolean
48 49 50 |
# File 'lib/expressir/config.rb', line 48 def benchmark_verbose? @benchmark_enabled && @benchmark_verbose end |