#[non_exhaustive]pub struct MonitoringQueryLanguageCondition {
pub query: String,
pub duration: Option<Duration>,
pub trigger: Option<Trigger>,
pub evaluation_missing_data: EvaluationMissingData,
/* private fields */
}Expand description
A condition type that allows alerting policies to be defined using Monitoring Query Language.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.query: StringMonitoring Query Language query that outputs a boolean stream.
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: EvaluationMissingDataA condition control that determines how metric-threshold conditions are evaluated when data stops arriving.
Implementations§
Source§impl MonitoringQueryLanguageCondition
impl MonitoringQueryLanguageCondition
pub fn new() -> Self
Sourcepub fn set_duration<T>(self, v: T) -> Self
pub fn set_duration<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_duration<T>(self, v: Option<T>) -> Self
Sourcepub fn set_trigger<T>(self, v: T) -> Self
pub fn set_trigger<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_trigger<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_trigger<T>(self, v: Option<T>) -> Self
Sets or clears the value of trigger.
§Example
use google_cloud_monitoring_v3::model::alert_policy::condition::Trigger;
let x = MonitoringQueryLanguageCondition::new().set_or_clear_trigger(Some(Trigger::default()/* use setters */));
let x = MonitoringQueryLanguageCondition::new().set_or_clear_trigger(None::<Trigger>);Sourcepub fn set_evaluation_missing_data<T: Into<EvaluationMissingData>>(
self,
v: T,
) -> Self
pub fn set_evaluation_missing_data<T: Into<EvaluationMissingData>>( self, v: T, ) -> Self
Sets the value of evaluation_missing_data.
§Example
use google_cloud_monitoring_v3::model::alert_policy::condition::EvaluationMissingData;
let x0 = MonitoringQueryLanguageCondition::new().set_evaluation_missing_data(EvaluationMissingData::Inactive);
let x1 = MonitoringQueryLanguageCondition::new().set_evaluation_missing_data(EvaluationMissingData::Active);
let x2 = MonitoringQueryLanguageCondition::new().set_evaluation_missing_data(EvaluationMissingData::NoOp);Trait Implementations§
Source§impl Clone for MonitoringQueryLanguageCondition
impl Clone for MonitoringQueryLanguageCondition
Source§fn clone(&self) -> MonitoringQueryLanguageCondition
fn clone(&self) -> MonitoringQueryLanguageCondition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for MonitoringQueryLanguageCondition
impl Default for MonitoringQueryLanguageCondition
Source§fn default() -> MonitoringQueryLanguageCondition
fn default() -> MonitoringQueryLanguageCondition
Source§impl PartialEq for MonitoringQueryLanguageCondition
impl PartialEq for MonitoringQueryLanguageCondition
Source§fn eq(&self, other: &MonitoringQueryLanguageCondition) -> bool
fn eq(&self, other: &MonitoringQueryLanguageCondition) -> bool
self and other values to be equal, and is used by ==.