#[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
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BackendCustomMetric
impl Debug for BackendCustomMetric
Source§impl Default for BackendCustomMetric
impl Default for BackendCustomMetric
Source§fn default() -> BackendCustomMetric
fn default() -> BackendCustomMetric
Source§impl Message for BackendCustomMetric
impl Message for BackendCustomMetric
Source§impl PartialEq for BackendCustomMetric
impl PartialEq for BackendCustomMetric
impl StructuralPartialEq for BackendCustomMetric
Auto Trait Implementations§
impl Freeze for BackendCustomMetric
impl RefUnwindSafe for BackendCustomMetric
impl Send for BackendCustomMetric
impl Sync for BackendCustomMetric
impl Unpin for BackendCustomMetric
impl UnsafeUnpin for BackendCustomMetric
impl UnwindSafe for BackendCustomMetric
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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