Class: Expressir::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/expressir/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_enabledObject

Returns the value of attribute benchmark_enabled.



15
16
17
# File 'lib/expressir/config.rb', line 15

def benchmark_enabled
  @benchmark_enabled
end

#benchmark_formatObject

Returns the value of attribute benchmark_format.



15
16
17
# File 'lib/expressir/config.rb', line 15

def benchmark_format
  @benchmark_format
end

#benchmark_ipsObject

Returns the value of attribute benchmark_ips.



15
16
17
# File 'lib/expressir/config.rb', line 15

def benchmark_ips
  @benchmark_ips
end

#benchmark_iterationsObject

Returns the value of attribute benchmark_iterations.



15
16
17
# File 'lib/expressir/config.rb', line 15

def benchmark_iterations
  @benchmark_iterations
end

#benchmark_parallelObject

Returns the value of attribute benchmark_parallel.



15
16
17
# File 'lib/expressir/config.rb', line 15

def benchmark_parallel
  @benchmark_parallel
end

#benchmark_saveObject

Returns the value of attribute benchmark_save.



15
16
17
# File 'lib/expressir/config.rb', line 15

def benchmark_save
  @benchmark_save
end

#benchmark_verboseObject

Returns the value of attribute benchmark_verbose.



15
16
17
# File 'lib/expressir/config.rb', line 15

def benchmark_verbose
  @benchmark_verbose
end

#benchmark_warmupObject

Returns the value of attribute benchmark_warmup.



15
16
17
# File 'lib/expressir/config.rb', line 15

def benchmark_warmup
  @benchmark_warmup
end

#logsObject

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

Returns:

  • (Boolean)


40
41
42
# File 'lib/expressir/config.rb', line 40

def benchmark_enabled?
  @benchmark_enabled
end

#benchmark_ips?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/expressir/config.rb', line 44

def benchmark_ips?
  @benchmark_enabled && @benchmark_ips
end

#benchmark_parallel?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/expressir/config.rb', line 56

def benchmark_parallel?
  @benchmark_enabled && @benchmark_parallel
end

#benchmark_save?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/expressir/config.rb', line 52

def benchmark_save?
  @benchmark_enabled && @benchmark_save
end

#benchmark_verbose?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/expressir/config.rb', line 48

def benchmark_verbose?
  @benchmark_enabled && @benchmark_verbose
end