1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Application request metrics for an AWS Elastic Beanstalk environment.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ApplicationMetrics {
    /// <p>The amount of time that the metrics cover (usually 10 seconds). For example, you might have 5 requests (<code>request_count</code>) within the most recent time slice of 10 seconds (<code>duration</code>).</p>
    pub duration: ::std::option::Option<i32>,
    /// <p>Average number of requests handled by the web server per second over the last 10 seconds.</p>
    pub request_count: i32,
    /// <p>Represents the percentage of requests over the last 10 seconds that resulted in each type of status code response.</p>
    pub status_codes: ::std::option::Option<crate::types::StatusCodes>,
    /// <p>Represents the average latency for the slowest X percent of requests over the last 10 seconds. Latencies are in seconds with one millisecond resolution.</p>
    pub latency: ::std::option::Option<crate::types::Latency>,
}
impl ApplicationMetrics {
    /// <p>The amount of time that the metrics cover (usually 10 seconds). For example, you might have 5 requests (<code>request_count</code>) within the most recent time slice of 10 seconds (<code>duration</code>).</p>
    pub fn duration(&self) -> ::std::option::Option<i32> {
        self.duration
    }
    /// <p>Average number of requests handled by the web server per second over the last 10 seconds.</p>
    pub fn request_count(&self) -> i32 {
        self.request_count
    }
    /// <p>Represents the percentage of requests over the last 10 seconds that resulted in each type of status code response.</p>
    pub fn status_codes(&self) -> ::std::option::Option<&crate::types::StatusCodes> {
        self.status_codes.as_ref()
    }
    /// <p>Represents the average latency for the slowest X percent of requests over the last 10 seconds. Latencies are in seconds with one millisecond resolution.</p>
    pub fn latency(&self) -> ::std::option::Option<&crate::types::Latency> {
        self.latency.as_ref()
    }
}
impl ApplicationMetrics {
    /// Creates a new builder-style object to manufacture [`ApplicationMetrics`](crate::types::ApplicationMetrics).
    pub fn builder() -> crate::types::builders::ApplicationMetricsBuilder {
        crate::types::builders::ApplicationMetricsBuilder::default()
    }
}

/// A builder for [`ApplicationMetrics`](crate::types::ApplicationMetrics).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ApplicationMetricsBuilder {
    pub(crate) duration: ::std::option::Option<i32>,
    pub(crate) request_count: ::std::option::Option<i32>,
    pub(crate) status_codes: ::std::option::Option<crate::types::StatusCodes>,
    pub(crate) latency: ::std::option::Option<crate::types::Latency>,
}
impl ApplicationMetricsBuilder {
    /// <p>The amount of time that the metrics cover (usually 10 seconds). For example, you might have 5 requests (<code>request_count</code>) within the most recent time slice of 10 seconds (<code>duration</code>).</p>
    pub fn duration(mut self, input: i32) -> Self {
        self.duration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The amount of time that the metrics cover (usually 10 seconds). For example, you might have 5 requests (<code>request_count</code>) within the most recent time slice of 10 seconds (<code>duration</code>).</p>
    pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
        self.duration = input;
        self
    }
    /// <p>The amount of time that the metrics cover (usually 10 seconds). For example, you might have 5 requests (<code>request_count</code>) within the most recent time slice of 10 seconds (<code>duration</code>).</p>
    pub fn get_duration(&self) -> &::std::option::Option<i32> {
        &self.duration
    }
    /// <p>Average number of requests handled by the web server per second over the last 10 seconds.</p>
    pub fn request_count(mut self, input: i32) -> Self {
        self.request_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>Average number of requests handled by the web server per second over the last 10 seconds.</p>
    pub fn set_request_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.request_count = input;
        self
    }
    /// <p>Average number of requests handled by the web server per second over the last 10 seconds.</p>
    pub fn get_request_count(&self) -> &::std::option::Option<i32> {
        &self.request_count
    }
    /// <p>Represents the percentage of requests over the last 10 seconds that resulted in each type of status code response.</p>
    pub fn status_codes(mut self, input: crate::types::StatusCodes) -> Self {
        self.status_codes = ::std::option::Option::Some(input);
        self
    }
    /// <p>Represents the percentage of requests over the last 10 seconds that resulted in each type of status code response.</p>
    pub fn set_status_codes(mut self, input: ::std::option::Option<crate::types::StatusCodes>) -> Self {
        self.status_codes = input;
        self
    }
    /// <p>Represents the percentage of requests over the last 10 seconds that resulted in each type of status code response.</p>
    pub fn get_status_codes(&self) -> &::std::option::Option<crate::types::StatusCodes> {
        &self.status_codes
    }
    /// <p>Represents the average latency for the slowest X percent of requests over the last 10 seconds. Latencies are in seconds with one millisecond resolution.</p>
    pub fn latency(mut self, input: crate::types::Latency) -> Self {
        self.latency = ::std::option::Option::Some(input);
        self
    }
    /// <p>Represents the average latency for the slowest X percent of requests over the last 10 seconds. Latencies are in seconds with one millisecond resolution.</p>
    pub fn set_latency(mut self, input: ::std::option::Option<crate::types::Latency>) -> Self {
        self.latency = input;
        self
    }
    /// <p>Represents the average latency for the slowest X percent of requests over the last 10 seconds. Latencies are in seconds with one millisecond resolution.</p>
    pub fn get_latency(&self) -> &::std::option::Option<crate::types::Latency> {
        &self.latency
    }
    /// Consumes the builder and constructs a [`ApplicationMetrics`](crate::types::ApplicationMetrics).
    pub fn build(self) -> crate::types::ApplicationMetrics {
        crate::types::ApplicationMetrics {
            duration: self.duration,
            request_count: self.request_count.unwrap_or_default(),
            status_codes: self.status_codes,
            latency: self.latency,
        }
    }
}