Class: SnowAgent::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/snowagent/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
# 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_timeoutObject

Timout when opening connection to the server



13
14
15
# File 'lib/snowagent/configuration.rb', line 13

def open_timeout
  @open_timeout
end

#read_timeoutObject

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_tokenObject

Secret access token for authentication with SnowmanIO



7
8
9
# File 'lib/snowagent/configuration.rb', line 7

def secret_token
  @secret_token
end

#serverObject

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.

Returns:

  • (Boolean)


24
25
26
# File 'lib/snowagent/configuration.rb', line 24

def configured?
  !server.nil? && !secret_token.nil?
end