Class: Google::Apis::AppengineV1beta::CustomMetric

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/appengine_v1beta/classes.rb,
generated/google/apis/appengine_v1beta/representations.rb,
generated/google/apis/appengine_v1beta/representations.rb

Overview

Allows autoscaling based on Stackdriver metrics.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ CustomMetric

Returns a new instance of CustomMetric.


709
710
711
# File 'generated/google/apis/appengine_v1beta/classes.rb', line 709

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#filterString

Allows filtering on the metric's fields. Corresponds to the JSON property filter

Returns:

  • (String)

683
684
685
# File 'generated/google/apis/appengine_v1beta/classes.rb', line 683

def filter
  @filter
end

#metric_nameString

The name of the metric. Corresponds to the JSON property metricName

Returns:

  • (String)

688
689
690
# File 'generated/google/apis/appengine_v1beta/classes.rb', line 688

def metric_name
  @metric_name
end

#single_instance_assignmentFloat

May be used instead of target_utilization when an instance can handle a specific amount of work/resources and the metric value is equal to the current amount of work remaining. The autoscaler will try to keep the number of instances equal to the metric value divided by single_instance_assignment. Corresponds to the JSON property singleInstanceAssignment

Returns:

  • (Float)

696
697
698
# File 'generated/google/apis/appengine_v1beta/classes.rb', line 696

def single_instance_assignment
  @single_instance_assignment
end

#target_typeString

The type of the metric. Must be a string representing a Stackdriver metric type e.g. GAGUE, DELTA_PER_SECOND, etc. Corresponds to the JSON property targetType

Returns:

  • (String)

702
703
704
# File 'generated/google/apis/appengine_v1beta/classes.rb', line 702

def target_type
  @target_type
end

#target_utilizationFloat

The target value for the metric. Corresponds to the JSON property targetUtilization

Returns:

  • (Float)

707
708
709
# File 'generated/google/apis/appengine_v1beta/classes.rb', line 707

def target_utilization
  @target_utilization
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


714
715
716
717
718
719
720
# File 'generated/google/apis/appengine_v1beta/classes.rb', line 714

def update!(**args)
  @filter = args[:filter] if args.key?(:filter)
  @metric_name = args[:metric_name] if args.key?(:metric_name)
  @single_instance_assignment = args[:single_instance_assignment] if args.key?(:single_instance_assignment)
  @target_type = args[:target_type] if args.key?(:target_type)
  @target_utilization = args[:target_utilization] if args.key?(:target_utilization)
end