Class: Neetodeploy::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/neetodeploy/autoscale/config.rb

Constant Summary collapse

DEFAULT_METRICS_URL =
"http://nd-queue-time-exporter-web-deployment:3000/metrics"
DEFAULT_BATCH_URL =
"http://nd-queue-time-exporter-web-deployment:3000/metrics/batch"
DEFAULT_AUTH_TOKEN =
"K0An3O3MSyEEMTCnRd1IHgGjdGQkzy"
DEFAULT_REPORT_INTERVAL =
10

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



13
14
15
16
17
18
19
20
21
22
# File 'lib/neetodeploy/autoscale/config.rb', line 13

def initialize
  @app_name = ENV["NEETODEPLOY_APP_NAME"]
  @metrics_server_url = DEFAULT_METRICS_URL
  @metrics_server_batch_url = DEFAULT_BATCH_URL
  @metrics_server_auth_token = DEFAULT_AUTH_TOKEN
  @report_interval_seconds = (ENV["NEETODEPLOY_REPORT_INTERVAL_SECONDS"]&.to_i || DEFAULT_REPORT_INTERVAL)
  @gem_disabled = ENV["DISABLE_NEETO_DEPLOY_AUTOSCALE"] == "true"
  @sidekiq_metrics_disabled = ENV["DISABLE_NEETO_DEPLOY_SIDEKIQ_METRICS"] == "true"
  @batch_processing_enabled = ENV["NEETODEPLOY_BATCH_PROCESSING_ENABLED"] == "true"
end

Instance Attribute Details

#app_nameObject (readonly)

Returns the value of attribute app_name.



10
11
12
# File 'lib/neetodeploy/autoscale/config.rb', line 10

def app_name
  @app_name
end

#metrics_server_auth_tokenObject (readonly)

Returns the value of attribute metrics_server_auth_token.



10
11
12
# File 'lib/neetodeploy/autoscale/config.rb', line 10

def metrics_server_auth_token
  @metrics_server_auth_token
end

#metrics_server_batch_urlObject (readonly)

Returns the value of attribute metrics_server_batch_url.



10
11
12
# File 'lib/neetodeploy/autoscale/config.rb', line 10

def metrics_server_batch_url
  @metrics_server_batch_url
end

#metrics_server_urlObject (readonly)

Returns the value of attribute metrics_server_url.



10
11
12
# File 'lib/neetodeploy/autoscale/config.rb', line 10

def metrics_server_url
  @metrics_server_url
end

#report_interval_secondsObject (readonly)

Returns the value of attribute report_interval_seconds.



10
11
12
# File 'lib/neetodeploy/autoscale/config.rb', line 10

def report_interval_seconds
  @report_interval_seconds
end

Instance Method Details

#batch_processing_enabled?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/neetodeploy/autoscale/config.rb', line 32

def batch_processing_enabled?
  @batch_processing_enabled
end

#gem_disabled?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/neetodeploy/autoscale/config.rb', line 24

def gem_disabled?
  @gem_disabled
end

#sidekiq_metrics_disabled?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/neetodeploy/autoscale/config.rb', line 28

def sidekiq_metrics_disabled?
  @sidekiq_metrics_disabled
end