Class: CpuInspectCore::Configuration
- Inherits:
-
Object
- Object
- CpuInspectCore::Configuration
- Defined in:
- lib/cpu_inspect_core/configuration.rb
Instance Attribute Summary collapse
-
#backend ⇒ Object
seconds between samples.
-
#bar_width ⇒ Object
seconds between samples.
-
#idle_threshold ⇒ Object
seconds between samples.
-
#interval ⇒ Object
seconds between samples.
-
#log_max_bytes ⇒ Object
seconds between samples.
-
#log_path ⇒ Object
seconds between samples.
-
#redis_key_prefix ⇒ Object
seconds between samples.
-
#redis_ttl ⇒ Object
seconds between samples.
-
#redis_url ⇒ Object
seconds between samples.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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
#backend ⇒ Object
seconds between samples
5 6 7 |
# File 'lib/cpu_inspect_core/configuration.rb', line 5 def backend @backend end |
#bar_width ⇒ Object
seconds between samples
5 6 7 |
# File 'lib/cpu_inspect_core/configuration.rb', line 5 def @bar_width end |
#idle_threshold ⇒ Object
seconds between samples
5 6 7 |
# File 'lib/cpu_inspect_core/configuration.rb', line 5 def idle_threshold @idle_threshold end |
#interval ⇒ Object
seconds between samples
5 6 7 |
# File 'lib/cpu_inspect_core/configuration.rb', line 5 def interval @interval end |
#log_max_bytes ⇒ Object
seconds between samples
5 6 7 |
# File 'lib/cpu_inspect_core/configuration.rb', line 5 def log_max_bytes @log_max_bytes end |
#log_path ⇒ Object
seconds between samples
5 6 7 |
# File 'lib/cpu_inspect_core/configuration.rb', line 5 def log_path @log_path end |
#redis_key_prefix ⇒ Object
seconds between samples
5 6 7 |
# File 'lib/cpu_inspect_core/configuration.rb', line 5 def redis_key_prefix @redis_key_prefix end |
#redis_ttl ⇒ Object
seconds between samples
5 6 7 |
# File 'lib/cpu_inspect_core/configuration.rb', line 5 def redis_ttl @redis_ttl end |
#redis_url ⇒ Object
seconds between samples
5 6 7 |
# File 'lib/cpu_inspect_core/configuration.rb', line 5 def redis_url @redis_url end |