#[non_exhaustive]pub struct ResponseHeadersPolicyServerTimingHeadersConfig {
pub enabled: bool,
pub sampling_rate: Option<f64>,
}
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.
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.enabled: 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.
sampling_rate: 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.
Implementations§
source§impl ResponseHeadersPolicyServerTimingHeadersConfig
impl ResponseHeadersPolicyServerTimingHeadersConfig
sourcepub fn enabled(&self) -> bool
pub fn enabled(&self) -> 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() -> ResponseHeadersPolicyServerTimingHeadersConfigBuilder
pub fn builder() -> ResponseHeadersPolicyServerTimingHeadersConfigBuilder
Creates a new builder-style object to manufacture ResponseHeadersPolicyServerTimingHeadersConfig
.
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 moresource§impl PartialEq for ResponseHeadersPolicyServerTimingHeadersConfig
impl PartialEq for ResponseHeadersPolicyServerTimingHeadersConfig
source§fn eq(&self, other: &ResponseHeadersPolicyServerTimingHeadersConfig) -> bool
fn eq(&self, other: &ResponseHeadersPolicyServerTimingHeadersConfig) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ResponseHeadersPolicyServerTimingHeadersConfig
Auto Trait Implementations§
impl Freeze for ResponseHeadersPolicyServerTimingHeadersConfig
impl RefUnwindSafe for ResponseHeadersPolicyServerTimingHeadersConfig
impl Send for ResponseHeadersPolicyServerTimingHeadersConfig
impl Sync for ResponseHeadersPolicyServerTimingHeadersConfig
impl Unpin for ResponseHeadersPolicyServerTimingHeadersConfig
impl UnwindSafe for ResponseHeadersPolicyServerTimingHeadersConfig
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
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more