Class: Neetodeploy::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



8
9
10
11
12
13
14
15
16
# File 'lib/neetodeploy/autoscale/config.rb', line 8

def initialize
  @disable_auto_scale_gem = ENV["DISABLE_NEETO_DEPLOY_AUTOSCALE"]
  @disable_sidekiq_metrics = ENV["DISABLE_NEETO_DEPLOY_SIDEKIQ_METRICS"]
  @app_name = ENV["NEETODEPLOY_APP_NAME"]
  @process_type = ENV["NEETODEPLOY_PROCESS_TYPE"] || "worker"
  @metrics_server_url = "http://nd-queue-time-exporter-web-deployment:3000/metrics"
  @metrics_server_auth_token = "K0An3O3MSyEEMTCnRd1IHgGjdGQkzy"
  @report_interval_seconds = 10
end

Instance Attribute Details

#app_nameObject

Returns the value of attribute app_name.



5
6
7
# File 'lib/neetodeploy/autoscale/config.rb', line 5

def app_name
  @app_name
end

#disable_auto_scale_gemObject

Returns the value of attribute disable_auto_scale_gem.



5
6
7
# File 'lib/neetodeploy/autoscale/config.rb', line 5

def disable_auto_scale_gem
  @disable_auto_scale_gem
end

#disable_sidekiq_metricsObject

Returns the value of attribute disable_sidekiq_metrics.



5
6
7
# File 'lib/neetodeploy/autoscale/config.rb', line 5

def disable_sidekiq_metrics
  @disable_sidekiq_metrics
end

#metrics_server_auth_tokenObject

Returns the value of attribute metrics_server_auth_token.



5
6
7
# File 'lib/neetodeploy/autoscale/config.rb', line 5

def metrics_server_auth_token
  @metrics_server_auth_token
end

#metrics_server_urlObject

Returns the value of attribute metrics_server_url.



5
6
7
# File 'lib/neetodeploy/autoscale/config.rb', line 5

def metrics_server_url
  @metrics_server_url
end

#process_typeObject

Returns the value of attribute process_type.



5
6
7
# File 'lib/neetodeploy/autoscale/config.rb', line 5

def process_type
  @process_type
end

#report_interval_secondsObject

Returns the value of attribute report_interval_seconds.



5
6
7
# File 'lib/neetodeploy/autoscale/config.rb', line 5

def report_interval_seconds
  @report_interval_seconds
end

Instance Method Details

#deployment_nameObject



18
19
20
# File 'lib/neetodeploy/autoscale/config.rb', line 18

def deployment_name
  "#{app_name}-#{process_type}-deployment"
end

#gem_disabled?Boolean

Returns:



22
23
24
# File 'lib/neetodeploy/autoscale/config.rb', line 22

def gem_disabled?
  disable_auto_scale_gem == "true"
end

#sidekiq_metrics_disabled?Boolean

Returns:



26
27
28
# File 'lib/neetodeploy/autoscale/config.rb', line 26

def sidekiq_metrics_disabled?
  disable_sidekiq_metrics == "true"
end