Class: SnowAgent::Configuration
- Inherits:
-
Object
- Object
- SnowAgent::Configuration
- Defined in:
- lib/snowagent/configuration.rb
Instance Attribute Summary collapse
-
#open_timeout ⇒ Object
Timout when opening connection to the server.
-
#read_timeout ⇒ Object
Timeout when waiting for the server to return data in seconds.
-
#secret_token ⇒ Object
Secret access token for authentication with SnowmanIO.
-
#server ⇒ Object
Base URL of the SnowmanIO server.
Instance Method Summary collapse
-
#configured? ⇒ Boolean
Determines if the agent confiured to send metrics.
-
#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 |
# File 'lib/snowagent/configuration.rb', line 15 def initialize self.server = ENV['SNOWMANIO_SERVER'] self.secret_token = ENV['SNOWMANIO_SECRET_TOKEN'] self.read_timeout = 30 self.open_timeout = 30 end |
Instance Attribute Details
#open_timeout ⇒ Object
Timout when opening connection to the server
13 14 15 |
# File 'lib/snowagent/configuration.rb', line 13 def open_timeout @open_timeout end |
#read_timeout ⇒ Object
Timeout when waiting for the server to return data in seconds
10 11 12 |
# File 'lib/snowagent/configuration.rb', line 10 def read_timeout @read_timeout end |
#secret_token ⇒ Object
Secret access token for authentication with SnowmanIO
7 8 9 |
# File 'lib/snowagent/configuration.rb', line 7 def secret_token @secret_token end |
#server ⇒ Object
Base URL of the SnowmanIO server
4 5 6 |
# File 'lib/snowagent/configuration.rb', line 4 def server @server end |
Instance Method Details
#configured? ⇒ Boolean
Determines if the agent confiured to send metrics.
24 25 26 |
# File 'lib/snowagent/configuration.rb', line 24 def configured? !server.nil? && !secret_token.nil? end |