Metric

class oci.autoscaling.models.Metric(**kwargs)

Bases: oci.autoscaling.models.metric_base.MetricBase

Metric and threshold details for triggering an autoscaling action based on CPU or memory utilization.

Attributes

METRIC_SOURCE_COMPUTE_AGENT str(object=’’) -> str
METRIC_SOURCE_CUSTOM_QUERY str(object=’’) -> str
METRIC_TYPE_CPU_UTILIZATION A constant which can be used with the metric_type property of a Metric.
METRIC_TYPE_MEMORY_UTILIZATION A constant which can be used with the metric_type property of a Metric.
metric_source Gets the metric_source of this MetricBase.
metric_type [Required] Gets the metric_type of this Metric.
pending_duration Gets the pending_duration of this MetricBase.
threshold [Required] Gets the threshold of this Metric.

Methods

__init__(**kwargs) Initializes a new Metric object with values from keyword arguments.
get_subtype(object_dictionary) Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
METRIC_SOURCE_COMPUTE_AGENT = 'COMPUTE_AGENT'
METRIC_SOURCE_CUSTOM_QUERY = 'CUSTOM_QUERY'
METRIC_TYPE_CPU_UTILIZATION = 'CPU_UTILIZATION'

A constant which can be used with the metric_type property of a Metric. This constant has a value of “CPU_UTILIZATION”

METRIC_TYPE_MEMORY_UTILIZATION = 'MEMORY_UTILIZATION'

A constant which can be used with the metric_type property of a Metric. This constant has a value of “MEMORY_UTILIZATION”

__init__(**kwargs)

Initializes a new Metric object with values from keyword arguments. The default value of the metric_source attribute of this class is COMPUTE_AGENT and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • pending_duration (str) – The value to assign to the pending_duration property of this Metric.
  • metric_source (str) – The value to assign to the metric_source property of this Metric. Allowed values for this property are: “COMPUTE_AGENT”, “CUSTOM_QUERY”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • metric_type (str) – The value to assign to the metric_type property of this Metric. Allowed values for this property are: “CPU_UTILIZATION”, “MEMORY_UTILIZATION”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • threshold (oci.autoscaling.models.Threshold) – The value to assign to the threshold property of this Metric.
static get_subtype(object_dictionary)

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.

metric_source

Gets the metric_source of this MetricBase. Source of the metric data for creating the alarm used to trigger autoscaling actions.

The following values are supported:

  • COMPUTE_AGENT: CPU or memory metrics emitted by the Compute Instance Monitoring plugin.
  • CUSTOM_QUERY: A custom Monitoring Query Language (MQL) expression.

Allowed values for this property are: “COMPUTE_AGENT”, “CUSTOM_QUERY”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The metric_source of this MetricBase.
Return type:str
metric_type

[Required] Gets the metric_type of this Metric. Allowed values for this property are: “CPU_UTILIZATION”, “MEMORY_UTILIZATION”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The metric_type of this Metric.
Return type:str
pending_duration

Gets the pending_duration of this MetricBase. The period of time that the condition defined in the alarm must persist before the alarm state changes from “OK” to “FIRING” or vice versa. For example, a value of 5 minutes means that the alarm must persist in breaching the condition for five minutes before the alarm updates its state to “FIRING”; likewise, the alarm must persist in not breaching the condition for five minutes before the alarm updates its state to “OK.”

The duration is specified as a string in ISO 8601 format (PT10M for ten minutes or PT1H for one hour). Minimum: PT3M. Maximum: PT1H. Default: PT3M.

Returns:The pending_duration of this MetricBase.
Return type:str
threshold

[Required] Gets the threshold of this Metric.

Returns:The threshold of this Metric.
Return type:oci.autoscaling.models.Threshold