Class: Google::Apis::AutoscalerV1beta2::AutoscalingPolicyCustomMetricUtilization

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

Overview

Custom utilization metric policy.

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) ⇒ AutoscalingPolicyCustomMetricUtilization

Returns a new instance of AutoscalingPolicyCustomMetricUtilization



218
219
220
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 218

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

Instance Attribute Details

#metricString

Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric ( increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis. com/instance/network/received_bytes_count. Corresponds to the JSON property metric

Returns:

  • (String)


205
206
207
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 205

def metric
  @metric
end

#utilization_targetFloat

Target value of the metric which Autoscaler should maintain. Must be a positive value. Corresponds to the JSON property utilizationTarget

Returns:

  • (Float)


211
212
213
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 211

def utilization_target
  @utilization_target
end

#utilization_target_typeString

Defines type in which utilization_target is expressed. Corresponds to the JSON property utilizationTargetType

Returns:

  • (String)


216
217
218
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 216

def utilization_target_type
  @utilization_target_type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



223
224
225
226
227
# File 'generated/google/apis/autoscaler_v1beta2/classes.rb', line 223

def update!(**args)
  @metric = args[:metric] if args.key?(:metric)
  @utilization_target = args[:utilization_target] if args.key?(:utilization_target)
  @utilization_target_type = args[:utilization_target_type] if args.key?(:utilization_target_type)
end