Class: PumaCloudwatch::Metrics::Looper
- Inherits:
-
Object
- Object
- PumaCloudwatch::Metrics::Looper
- Defined in:
- lib/puma_cloudwatch/metrics/looper.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Looper
constructor
A new instance of Looper.
- #message ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Looper
Returns a new instance of Looper.
7 8 9 10 11 12 13 14 |
# File 'lib/puma_cloudwatch/metrics/looper.rb', line 7 def initialize() @options = @control_url = [:control_url] @control_auth_token = [:control_auth_token] @frequency = Integer(ENV['PUMA_CLOUDWATCH_FREQUENCY'] || 60) @enabled = ENV['PUMA_CLOUDWATCH_ENABLED'] || false @fetched = false end |
Class Method Details
.run(options) ⇒ Object
3 4 5 |
# File 'lib/puma_cloudwatch/metrics/looper.rb', line 3 def self.run() new().run end |
Instance Method Details
#message ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/puma_cloudwatch/metrics/looper.rb', line 24 def = "puma-cloudwatch plugin: Will send data every #{@frequency} seconds." unless @enabled to_enable = "To enable set the environment variable PUMA_CLOUDWATCH_ENABLED=1" = "Disabled: #{}\n#{to_enable}" end end |