Struct google_api_proto::google::monitoring::v3::alert_policy::condition::MetricThreshold
source · pub struct MetricThreshold {
pub filter: String,
pub aggregations: Vec<Aggregation>,
pub denominator_filter: String,
pub denominator_aggregations: Vec<Aggregation>,
pub forecast_options: Option<ForecastOptions>,
pub comparison: i32,
pub threshold_value: f64,
pub duration: Option<Duration>,
pub trigger: Option<Trigger>,
pub evaluation_missing_data: i32,
}
Expand description
A condition type that compares a collection of time series against a threshold.
Fields§
§filter: String
Required. A filter that identifies which time series should be compared with the threshold.
The filter is similar to the one that is specified in the
ListTimeSeries
request
(that call is useful to verify the time series that will be retrieved /
processed). The filter must specify the metric type and the resource
type. Optionally, it can specify resource labels and metric labels.
This field must not exceed 2048 Unicode characters in length.
aggregations: Vec<Aggregation>
Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series together (such as when aggregating multiple streams on each resource to a single stream for each resource or when aggregating streams across all members of a group of resources). Multiple aggregations are applied in the order specified.
This field is similar to the one in the ListTimeSeries
request.
It is advisable to use the ListTimeSeries
method when debugging this
field.
denominator_filter: String
A filter that
identifies a time series that should be used as the denominator of a
ratio that will be compared with the threshold. If a
denominator_filter
is specified, the time series specified by the
filter
field will be used as the numerator.
The filter must specify the metric type and optionally may contain restrictions on resource type, resource labels, and metric labels. This field may not exceed 2048 Unicode characters in length.
denominator_aggregations: Vec<Aggregation>
Specifies the alignment of data points in individual time series
selected by denominatorFilter
as
well as how to combine the retrieved time series together (such as
when aggregating multiple streams on each resource to a single
stream for each resource or when aggregating streams across all
members of a group of resources).
When computing ratios, the aggregations
and
denominator_aggregations
fields must use the same alignment period
and produce time series that have the same periodicity and labels.
forecast_options: Option<ForecastOptions>
When this field is present, the MetricThreshold
condition forecasts
whether the time series is predicted to violate the threshold within
the forecast_horizon
. When this field is not set, the
MetricThreshold
tests the current value of the timeseries against the
threshold.
comparison: i32
The comparison to apply between the time series (indicated by filter
and aggregation
) and the threshold (indicated by threshold_value
).
The comparison is applied on each time series, with the time series
on the left-hand side and the threshold on the right-hand side.
Only COMPARISON_LT
and COMPARISON_GT
are supported currently.
threshold_value: f64
A value against which to compare the time series.
duration: Option<Duration>
The amount of time that a time series must violate the
threshold to be considered failing. Currently, only values
that are a multiple of a minute–e.g., 0, 60, 120, or 300
seconds–are supported. If an invalid value is given, an
error will be returned. When choosing a duration, it is useful to
keep in mind the frequency of the underlying time series data
(which may also be affected by any alignments specified in the
aggregations
field); a good duration is long enough so that a single
outlier does not generate spurious alerts, but short enough that
unhealthy states are detected and alerted on quickly.
trigger: Option<Trigger>
The number/percent of time series for which the comparison must hold
in order for the condition to trigger. If unspecified, then the
condition will trigger if the comparison is true for any of the
time series that have been identified by filter
and aggregations
,
or by the ratio, if denominator_filter
and denominator_aggregations
are specified.
evaluation_missing_data: i32
A condition control that determines how metric-threshold conditions
are evaluated when data stops arriving. To use this control, the value
of the duration
field must be greater than or equal to 60 seconds.
Implementations§
source§impl MetricThreshold
impl MetricThreshold
sourcepub fn comparison(&self) -> ComparisonType
pub fn comparison(&self) -> ComparisonType
Returns the enum value of comparison
, or the default if the field is set to an invalid enum value.
sourcepub fn set_comparison(&mut self, value: ComparisonType)
pub fn set_comparison(&mut self, value: ComparisonType)
Sets comparison
to the provided enum value.
sourcepub fn evaluation_missing_data(&self) -> EvaluationMissingData
pub fn evaluation_missing_data(&self) -> EvaluationMissingData
Returns the enum value of evaluation_missing_data
, or the default if the field is set to an invalid enum value.
sourcepub fn set_evaluation_missing_data(&mut self, value: EvaluationMissingData)
pub fn set_evaluation_missing_data(&mut self, value: EvaluationMissingData)
Sets evaluation_missing_data
to the provided enum value.
Trait Implementations§
source§impl Clone for MetricThreshold
impl Clone for MetricThreshold
source§fn clone(&self) -> MetricThreshold
fn clone(&self) -> MetricThreshold
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MetricThreshold
impl Debug for MetricThreshold
source§impl Default for MetricThreshold
impl Default for MetricThreshold
source§impl Message for MetricThreshold
impl Message for MetricThreshold
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for MetricThreshold
impl PartialEq for MetricThreshold
source§fn eq(&self, other: &MetricThreshold) -> bool
fn eq(&self, other: &MetricThreshold) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for MetricThreshold
Auto Trait Implementations§
impl Freeze for MetricThreshold
impl RefUnwindSafe for MetricThreshold
impl Send for MetricThreshold
impl Sync for MetricThreshold
impl Unpin for MetricThreshold
impl UnwindSafe for MetricThreshold
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request