AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: Aws::RailsProvisioner::Scaling::BaseScaling

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-rails-provisioner/scaling.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, options = {}) ⇒ BaseScaling

Configuration for scaling policy

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :disable_scale_in (Boolean)

    whether scale in by the target tracking policy is disabled, default as `false`

  • :scale_in_cooldown (Integer)

    period in seconds after a scale in activity completes before another scale in activity can start

  • :scale_out_cooldown (Integer)

    period in seconds after a scale in activity completes before another scale in activity can start

  • :target_util_percent (Integer)

    available for

    • :on_cpu , target average CPU utilization across the task

    • :on_memory , target average memory utilization across the task

  • :requests_per_target (Integer)

    available for :on_request, ALB requests per target



366
367
368
369
370
371
372
# File 'lib/aws-rails-provisioner/scaling.rb', line 366

def initialize(type, options = {})
  @disable_scale_in = !!options[:disable_scale_in]
  @scale_in_cooldown = options[:scale_in_cooldown]
  @scale_out_cooldown = options[:scale_out_cooldown]
  var_name = _type_2_var(type)
  instance_variable_set("@#{var_name}", options[var_name.to_sym])
end

Instance Attribute Details

#disable_scale_inBoolean (readonly)

Returns:

  • (Boolean)


381
382
383
# File 'lib/aws-rails-provisioner/scaling.rb', line 381

def disable_scale_in
  @disable_scale_in
end

#requests_per_targetInteger (readonly)

Returns:

  • (Integer)


378
379
380
# File 'lib/aws-rails-provisioner/scaling.rb', line 378

def requests_per_target
  @requests_per_target
end

#scale_in_cooldownInteger (readonly)

Returns:

  • (Integer)


384
385
386
# File 'lib/aws-rails-provisioner/scaling.rb', line 384

def scale_in_cooldown
  @scale_in_cooldown
end

#scale_out_cooldownInteger (readonly)

Returns:

  • (Integer)


387
388
389
# File 'lib/aws-rails-provisioner/scaling.rb', line 387

def scale_out_cooldown
  @scale_out_cooldown
end

#target_util_percentInteger (readonly)

Returns:

  • (Integer)


375
376
377
# File 'lib/aws-rails-provisioner/scaling.rb', line 375

def target_util_percent
  @target_util_percent
end