#[non_exhaustive]pub struct BackendCustomMetric {
pub dry_run: Option<bool>,
pub max_utilization: Option<f32>,
pub name: Option<String>,
/* private fields */
}backend-services or region-backend-services only.Expand description
Custom Metrics are used for CUSTOM_METRICS balancing_mode.
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.dry_run: Option<bool>If true, the metric data is collected and reported to Cloud Monitoring, but is not used for load balancing.
max_utilization: Option<f32>Optional parameter to define a target utilization for the Custom Metrics balancing mode. The valid range is [0.0, 1.0].
name: Option<String>Name of a custom utilization signal. The name must be 1-64 characters
long and match the regular expression
[a-z]([-_.a-z0-9]*[a-z0-9])? which means that the
first character must be a lowercase letter, and all following
characters must be a dash, period, underscore, lowercase letter, or
digit, except the last character, which cannot be a dash, period, or
underscore. For usage guidelines, see Custom Metrics balancing mode. This
field can only be used for a global or regional backend service with the
loadBalancingScheme set to EXTERNAL_MANAGED,INTERNAL_MANAGED INTERNAL_SELF_MANAGED.
Implementations§
Source§impl BackendCustomMetric
impl BackendCustomMetric
pub fn new() -> Self
Sourcepub fn set_dry_run<T>(self, v: T) -> Self
pub fn set_dry_run<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_dry_run<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_dry_run<T>(self, v: Option<T>) -> Self
Sourcepub fn set_max_utilization<T>(self, v: T) -> Self
pub fn set_max_utilization<T>(self, v: T) -> Self
Sets the value of max_utilization.
§Example
let x = BackendCustomMetric::new().set_max_utilization(42.0);Sourcepub fn set_or_clear_max_utilization<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_utilization<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_utilization.
§Example
let x = BackendCustomMetric::new().set_or_clear_max_utilization(Some(42.0));
let x = BackendCustomMetric::new().set_or_clear_max_utilization(None::<f32>);Trait Implementations§
Source§impl Clone for BackendCustomMetric
impl Clone for BackendCustomMetric
Source§fn clone(&self) -> BackendCustomMetric
fn clone(&self) -> BackendCustomMetric
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more