Class: Neetodeploy::Config
- Inherits:
-
Object
- Object
- Neetodeploy::Config
- 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
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#metrics_server_auth_token ⇒ Object
readonly
Returns the value of attribute metrics_server_auth_token.
-
#metrics_server_batch_url ⇒ Object
readonly
Returns the value of attribute metrics_server_batch_url.
-
#metrics_server_url ⇒ Object
readonly
Returns the value of attribute metrics_server_url.
-
#report_interval_seconds ⇒ Object
readonly
Returns the value of attribute report_interval_seconds.
Instance Method Summary collapse
- #batch_processing_enabled? ⇒ Boolean
- #gem_disabled? ⇒ Boolean
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #sidekiq_metrics_disabled? ⇒ Boolean
Constructor Details
#initialize ⇒ Config
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_name ⇒ Object (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_token ⇒ Object (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_url ⇒ Object (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_url ⇒ Object (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_seconds ⇒ Object (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
32 33 34 |
# File 'lib/neetodeploy/autoscale/config.rb', line 32 def batch_processing_enabled? @batch_processing_enabled end |
#gem_disabled? ⇒ Boolean
24 25 26 |
# File 'lib/neetodeploy/autoscale/config.rb', line 24 def gem_disabled? @gem_disabled end |
#sidekiq_metrics_disabled? ⇒ Boolean
28 29 30 |
# File 'lib/neetodeploy/autoscale/config.rb', line 28 def sidekiq_metrics_disabled? @sidekiq_metrics_disabled end |