#[non_exhaustive]pub struct ResponseHeadersPolicyServerTimingHeadersConfig { /* private fields */ }
Expand description
A configuration for enabling the Server-Timing
header in HTTP responses sent from CloudFront. CloudFront adds this header to HTTP responses that it sends in response to requests that match a cache behavior that's associated with this response headers policy.
You can use the Server-Timing
header to view metrics that can help you gain insights about the behavior and performance of CloudFront. For example, you can see which cache layer served a cache hit, or the first byte latency from the origin when there was a cache miss. You can use the metrics in the Server-Timing
header to troubleshoot issues or test the efficiency of your CloudFront configuration. For more information, see Server-Timing header in the Amazon CloudFront Developer Guide.
Implementations§
source§impl ResponseHeadersPolicyServerTimingHeadersConfig
impl ResponseHeadersPolicyServerTimingHeadersConfig
sourcepub fn enabled(&self) -> Option<bool>
pub fn enabled(&self) -> Option<bool>
A Boolean that determines whether CloudFront adds the Server-Timing
header to HTTP responses that it sends in response to requests that match a cache behavior that's associated with this response headers policy.
sourcepub fn sampling_rate(&self) -> Option<f64>
pub fn sampling_rate(&self) -> Option<f64>
A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add the Server-Timing
header to. When you set the sampling rate to 100, CloudFront adds the Server-Timing
header to the HTTP response for every request that matches the cache behavior that this response headers policy is attached to. When you set it to 50, CloudFront adds the header to 50% of the responses for requests that match the cache behavior. You can set the sampling rate to any number 0–100 with up to four decimal places.
source§impl ResponseHeadersPolicyServerTimingHeadersConfig
impl ResponseHeadersPolicyServerTimingHeadersConfig
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture ResponseHeadersPolicyServerTimingHeadersConfig
.
Examples found in repository?
10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721
pub fn deser_structure_crate_model_response_headers_policy_server_timing_headers_config(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<
crate::model::ResponseHeadersPolicyServerTimingHeadersConfig,
aws_smithy_xml::decode::XmlDecodeError,
> {
#[allow(unused_mut)]
let mut builder = crate::model::ResponseHeadersPolicyServerTimingHeadersConfig::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("Enabled") /* Enabled com.amazonaws.cloudfront#ResponseHeadersPolicyServerTimingHeadersConfig$Enabled */ => {
let var_431 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudfront#boolean`)"))
}
?
)
;
builder = builder.set_enabled(var_431);
}
,
s if s.matches("SamplingRate") /* SamplingRate com.amazonaws.cloudfront#ResponseHeadersPolicyServerTimingHeadersConfig$SamplingRate */ => {
let var_432 =
Some(
{
<f64 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (double: `com.amazonaws.cloudfront#SamplingRate`)"))
}
?
)
;
builder = builder.set_sampling_rate(var_432);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for ResponseHeadersPolicyServerTimingHeadersConfig
impl Clone for ResponseHeadersPolicyServerTimingHeadersConfig
source§fn clone(&self) -> ResponseHeadersPolicyServerTimingHeadersConfig
fn clone(&self) -> ResponseHeadersPolicyServerTimingHeadersConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more