Struct soup::MessageMetrics
source · pub struct MessageMetrics { /* private fields */ }
Expand description
Contains metrics collected while loading a Message
either from the
network or the disk cache.
Metrics are not collected by default for a Message
, you need to add the
flag MessageFlags::COLLECT_METRICS
to enable the feature.
Temporal metrics are expressed as a monotonic time and always start with a fetch start event and finish with response end. All other events are optional. An event can be 0 because it hasn’t happened yet, because it’s optional or because the load failed before the event reached.
Size metrics are expressed in bytes and are updated while the Message
is
being loaded. You can connect to different Message
signals to get the
final result of every value.
Implementations§
source§impl MessageMetrics
impl MessageMetrics
sourcepub fn as_ptr(&self) -> *mut SoupMessageMetrics
pub fn as_ptr(&self) -> *mut SoupMessageMetrics
Return the inner pointer to the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow<'a>(
ptr: *const *const SoupMessageMetrics
) -> &'a Self
pub unsafe fn from_glib_ptr_borrow<'a>( ptr: *const *const SoupMessageMetrics ) -> &'a Self
Borrows the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow_mut<'a>(
ptr: *mut *mut SoupMessageMetrics
) -> &'a mut Self
pub unsafe fn from_glib_ptr_borrow_mut<'a>( ptr: *mut *mut SoupMessageMetrics ) -> &'a mut Self
Borrows the underlying C value mutably.
source§impl MessageMetrics
impl MessageMetrics
sourcepub fn connect_end(&mut self) -> u64
pub fn connect_end(&mut self) -> u64
Get the time immediately after the Message
completed the
connection to the server. This includes the time for the proxy
negotiation and TLS handshake.
It will be 0 if no network connection was required to fetch the resource (a persistent connection was used or resource was loaded from the local disk cache).
§Returns
the connection end time
sourcepub fn connect_start(&mut self) -> u64
pub fn connect_start(&mut self) -> u64
sourcepub fn fetch_start(&mut self) -> u64
pub fn fetch_start(&mut self) -> u64
sourcepub fn request_body_bytes_sent(&mut self) -> u64
pub fn request_body_bytes_sent(&mut self) -> u64
Get the number of bytes sent to the network for the request body.
This is the size of the body sent, after encodings are applied, so it might
be greater than the value returned by
request_body_size()
. This value is available right
before wrote-body
signal is emitted, but you might get an
intermediate value if called before.
§Returns
the request body bytes sent
sourcepub fn request_body_size(&mut self) -> u64
pub fn request_body_size(&mut self) -> u64
Get the request body size in bytes. This is the size of the original body given to the request before any encoding is applied.
This value is available right before wrote-body
signal is
emitted, but you might get an intermediate value if called before.
§Returns
the request body size
sourcepub fn request_header_bytes_sent(&mut self) -> u64
pub fn request_header_bytes_sent(&mut self) -> u64
Get the number of bytes sent to the network for the request headers.
This value is available right before wrote-headers
signal
is emitted, but you might get an intermediate value if called before.
§Returns
the request headers bytes sent
sourcepub fn request_start(&mut self) -> u64
pub fn request_start(&mut self) -> u64
sourcepub fn response_body_bytes_received(&mut self) -> u64
pub fn response_body_bytes_received(&mut self) -> u64
Get the number of bytes received from the network for the response body.
This value is available right before got-body
signal is
emitted, but you might get an intermediate value if called before. For
resources loaded from the disk cache this value is always 0.
§Returns
the response body bytes received
sourcepub fn response_body_size(&mut self) -> u64
pub fn response_body_size(&mut self) -> u64
Get the response body size in bytes.
This is the size of the body as given to the user after all encodings are
applied, so it might be greater than the value returned by
response_body_bytes_received()
. This value is
available right before got-body
signal is emitted, but you
might get an intermediate value if called before.
§Returns
the response body size
sourcepub fn response_end(&mut self) -> u64
pub fn response_end(&mut self) -> u64
sourcepub fn response_header_bytes_received(&mut self) -> u64
pub fn response_header_bytes_received(&mut self) -> u64
Get the number of bytes received from the network for the response headers.
This value is available right before got-headers
signal
is emitted, but you might get an intermediate value if called before.
For resources loaded from the disk cache this value is always 0.
§Returns
the response headers bytes received
sourcepub fn response_start(&mut self) -> u64
pub fn response_start(&mut self) -> u64
Trait Implementations§
source§impl Clone for MessageMetrics
impl Clone for MessageMetrics
source§impl Debug for MessageMetrics
impl Debug for MessageMetrics
source§impl From<MessageMetrics> for Value
impl From<MessageMetrics> for Value
source§fn from(o: MessageMetrics) -> Self
fn from(o: MessageMetrics) -> Self
source§impl HasParamSpec for MessageMetrics
impl HasParamSpec for MessageMetrics
type ParamSpec = ParamSpecBoxed
§type SetValue = MessageMetrics
type SetValue = MessageMetrics
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, MessageMetrics>
fn param_spec_builder() -> Self::BuilderFn
source§impl Hash for MessageMetrics
impl Hash for MessageMetrics
source§impl Ord for MessageMetrics
impl Ord for MessageMetrics
source§fn cmp(&self, other: &MessageMetrics) -> Ordering
fn cmp(&self, other: &MessageMetrics) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for MessageMetrics
impl PartialEq for MessageMetrics
source§fn eq(&self, other: &MessageMetrics) -> bool
fn eq(&self, other: &MessageMetrics) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for MessageMetrics
impl PartialOrd for MessageMetrics
source§fn partial_cmp(&self, other: &MessageMetrics) -> Option<Ordering>
fn partial_cmp(&self, other: &MessageMetrics) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for MessageMetrics
impl StaticType for MessageMetrics
source§fn static_type() -> Type
fn static_type() -> Type
Self
.