Class: CpuInspectCore::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/cpu_inspect_core/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cpu_inspect_core/configuration.rb', line 15

def initialize
  @interval         = 2.0
  @log_path         = ENV.fetch('CPU_INSPECT_CORE_LOG', '/tmp/cpu_inspect_core.log')
  @log_max_bytes    = 1_048_576 # 1 MB
  @idle_threshold   = 2.0
  @bar_width        = 50
  @backend          = :file
  @redis_url        = ENV.fetch('REDIS_URL', 'redis://localhost:6379')
  @redis_key_prefix = 'cpu_inspect_core'
  @redis_ttl        = 30 # 15× the default 2s interval — dead dynos vanish quickly
end

Instance Attribute Details

#backendObject

seconds between samples



5
6
7
# File 'lib/cpu_inspect_core/configuration.rb', line 5

def backend
  @backend
end

#bar_widthObject

seconds between samples



5
6
7
# File 'lib/cpu_inspect_core/configuration.rb', line 5

def bar_width
  @bar_width
end

#idle_thresholdObject

seconds between samples



5
6
7
# File 'lib/cpu_inspect_core/configuration.rb', line 5

def idle_threshold
  @idle_threshold
end

#intervalObject

seconds between samples



5
6
7
# File 'lib/cpu_inspect_core/configuration.rb', line 5

def interval
  @interval
end

#log_max_bytesObject

seconds between samples



5
6
7
# File 'lib/cpu_inspect_core/configuration.rb', line 5

def log_max_bytes
  @log_max_bytes
end

#log_pathObject

seconds between samples



5
6
7
# File 'lib/cpu_inspect_core/configuration.rb', line 5

def log_path
  @log_path
end

#redis_key_prefixObject

seconds between samples



5
6
7
# File 'lib/cpu_inspect_core/configuration.rb', line 5

def redis_key_prefix
  @redis_key_prefix
end

#redis_ttlObject

seconds between samples



5
6
7
# File 'lib/cpu_inspect_core/configuration.rb', line 5

def redis_ttl
  @redis_ttl
end

#redis_urlObject

seconds between samples



5
6
7
# File 'lib/cpu_inspect_core/configuration.rb', line 5

def redis_url
  @redis_url
end