aws_sdk_elasticbeanstalk/types/
_system_status.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>CPU utilization and load average metrics for an Amazon EC2 instance.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SystemStatus {
7    /// <p>CPU utilization metrics for the instance.</p>
8    pub cpu_utilization: ::std::option::Option<crate::types::CpuUtilization>,
9    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
10    pub load_average: ::std::option::Option<::std::vec::Vec<f64>>,
11}
12impl SystemStatus {
13    /// <p>CPU utilization metrics for the instance.</p>
14    pub fn cpu_utilization(&self) -> ::std::option::Option<&crate::types::CpuUtilization> {
15        self.cpu_utilization.as_ref()
16    }
17    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.load_average.is_none()`.
20    pub fn load_average(&self) -> &[f64] {
21        self.load_average.as_deref().unwrap_or_default()
22    }
23}
24impl SystemStatus {
25    /// Creates a new builder-style object to manufacture [`SystemStatus`](crate::types::SystemStatus).
26    pub fn builder() -> crate::types::builders::SystemStatusBuilder {
27        crate::types::builders::SystemStatusBuilder::default()
28    }
29}
30
31/// A builder for [`SystemStatus`](crate::types::SystemStatus).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct SystemStatusBuilder {
35    pub(crate) cpu_utilization: ::std::option::Option<crate::types::CpuUtilization>,
36    pub(crate) load_average: ::std::option::Option<::std::vec::Vec<f64>>,
37}
38impl SystemStatusBuilder {
39    /// <p>CPU utilization metrics for the instance.</p>
40    pub fn cpu_utilization(mut self, input: crate::types::CpuUtilization) -> Self {
41        self.cpu_utilization = ::std::option::Option::Some(input);
42        self
43    }
44    /// <p>CPU utilization metrics for the instance.</p>
45    pub fn set_cpu_utilization(mut self, input: ::std::option::Option<crate::types::CpuUtilization>) -> Self {
46        self.cpu_utilization = input;
47        self
48    }
49    /// <p>CPU utilization metrics for the instance.</p>
50    pub fn get_cpu_utilization(&self) -> &::std::option::Option<crate::types::CpuUtilization> {
51        &self.cpu_utilization
52    }
53    /// Appends an item to `load_average`.
54    ///
55    /// To override the contents of this collection use [`set_load_average`](Self::set_load_average).
56    ///
57    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
58    pub fn load_average(mut self, input: f64) -> Self {
59        let mut v = self.load_average.unwrap_or_default();
60        v.push(input);
61        self.load_average = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
65    pub fn set_load_average(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
66        self.load_average = input;
67        self
68    }
69    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
70    pub fn get_load_average(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
71        &self.load_average
72    }
73    /// Consumes the builder and constructs a [`SystemStatus`](crate::types::SystemStatus).
74    pub fn build(self) -> crate::types::SystemStatus {
75        crate::types::SystemStatus {
76            cpu_utilization: self.cpu_utilization,
77            load_average: self.load_average,
78        }
79    }
80}