Class: Bulldogger::Config

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

Overview

Sets bounded runtime policy for capture, replay, redaction, and file output. It does not start capture or replay work. Environment overrides let a child change policy without app file changes.

Constant Summary collapse

DEFAULT_REDACT_PATTERNS =
[
  /pass(?:word|wd)?/i,
  /secret/i,
  /token/i,
  /api[_-]?key/i,
  /\bkey\b/i,
  /credential/i,
  /auth/i,
  /session/i,
  /cookie/i
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/bulldogger/config.rb', line 24

def initialize
  @enabled = true
  @output_dir = "tmp/bulldogger"
  @max_frames = 20
  @max_locals = 50
  @max_value_length = 200
  @max_pending = 32
  @max_samples = 10
  @redact_patterns = DEFAULT_REDACT_PATTERNS.dup
  @frame_source = :auto
  # Failure-only replay keeps full recording away from green runs, where
  # measurement showed a runtime cost of about sixty times.
  @replay_on_failure = true
  @max_replays = 1
  @replay_timeout = 60
  apply_env_overrides
end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def enabled
  @enabled
end

#frame_sourceObject

Returns the value of attribute frame_source.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def frame_source
  @frame_source
end

#max_framesObject

Returns the value of attribute max_frames.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def max_frames
  @max_frames
end

#max_localsObject

Returns the value of attribute max_locals.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def max_locals
  @max_locals
end

#max_pendingObject

Returns the value of attribute max_pending.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def max_pending
  @max_pending
end

#max_replaysObject

Returns the value of attribute max_replays.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def max_replays
  @max_replays
end

#max_samplesObject

Returns the value of attribute max_samples.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def max_samples
  @max_samples
end

#max_value_lengthObject

Returns the value of attribute max_value_length.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def max_value_length
  @max_value_length
end

#output_dirObject

Returns the value of attribute output_dir.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def output_dir
  @output_dir
end

#redact_patternsObject

Returns the value of attribute redact_patterns.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def redact_patterns
  @redact_patterns
end

#replay_on_failureObject

Returns the value of attribute replay_on_failure.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def replay_on_failure
  @replay_on_failure
end

#replay_timeoutObject

Returns the value of attribute replay_timeout.



20
21
22
# File 'lib/bulldogger/config.rb', line 20

def replay_timeout
  @replay_timeout
end