soup.message_metrics
Module for [MessageMetrics] class
class MessageMetrics
Types 1
Contains metrics collected while loading a class@Message either from the network or the disk cache.
Metrics are not collected by default for a class@Message, you need to add the flag [soup.types.MessageFlags.CollectMetrics] 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 class@Message is being loaded. You can connect to different class@Message signals to get the final result of every value.
Methods
MessageMetrics self()Returns `this`, for use in `with` statements.soup.message_metrics.MessageMetrics copy()Copies metrics. Returns: a copy of metricsulong getConnectEnd()Get the time immediately after the `classMessage` completed the connection to the server. This includes the time for the proxy negotiation and TLS handshake.ulong getConnectStart()Get the time immediately before the `classMessage` started to establish the connection to the server.ulong getDnsEnd()Get the time immediately after the `classMessage` completed the domain lookup name for the resource.ulong getDnsStart()Get the time immediately before the `classMessage` started the domain lookup name for the resource.ulong getFetchStart()Get the time immediately before the `classMessage` started to fetch a resource either from a remote server or local disk cache. Returns: the fetch start timeulong getRequestBodyBytesSent()Get the number of bytes sent to the network for the request body.ulong getRequestBodySize()Get the request body size in bytes. This is the size of the original body given to the request before any encoding is applied.ulong getRequestHeaderBytesSent()Get the number of bytes sent to the network for the request headers.ulong getRequestStart()Get the time immediately before the `classMessage` started the request of the resource from the server or the local disk cache. Returns: the request start timeulong getResponseBodyBytesReceived()Get the number of bytes received from the network for the response body.ulong getResponseBodySize()Get the response body size in bytes.ulong getResponseEnd()Get the time immediately after the `classMessage` received the last bytes of the response from the server or the local disk cache.ulong getResponseHeaderBytesReceived()Get the number of bytes received from the network for the response headers.ulong getResponseStart()Get the time immediately after the `classMessage` received the first bytes of the response from the server or the local disk cache. Returns: the response start timeulong getTlsStart()Get the time immediately before the `classMessage` started the TLS handshake.