Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Contains metrics collected while loading a [classmessage
] either from the
network or the disk cache.
Metrics are not collected by default for a [classmessage
], you need to add the
flag MessageFlagsCollectMetrics
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 [classmessage
] is
being loaded. You can connect to different [classmessage
] signals to get the
final result of every value.
Synopsis
- newtype MessageMetrics = MessageMetrics (ManagedPtr MessageMetrics)
- messageMetricsCopy :: (HasCallStack, MonadIO m) => MessageMetrics -> m MessageMetrics
- messageMetricsFree :: (HasCallStack, MonadIO m) => MessageMetrics -> m ()
- messageMetricsGetConnectEnd :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetConnectStart :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetDnsEnd :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetDnsStart :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetFetchStart :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetRequestBodyBytesSent :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetRequestBodySize :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetRequestHeaderBytesSent :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetRequestStart :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetResponseBodyBytesReceived :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetResponseBodySize :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetResponseEnd :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetResponseHeaderBytesReceived :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetResponseStart :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
- messageMetricsGetTlsStart :: (HasCallStack, MonadIO m) => MessageMetrics -> m Word64
Exported types
newtype MessageMetrics Source #
Memory-managed wrapper type.
MessageMetrics (ManagedPtr MessageMetrics) |
Instances
Eq MessageMetrics Source # | |
Defined in GI.Soup.Structs.MessageMetrics (==) :: MessageMetrics -> MessageMetrics -> Bool # (/=) :: MessageMetrics -> MessageMetrics -> Bool # | |
GBoxed MessageMetrics Source # | |
Defined in GI.Soup.Structs.MessageMetrics | |
ManagedPtrNewtype MessageMetrics Source # | |
Defined in GI.Soup.Structs.MessageMetrics toManagedPtr :: MessageMetrics -> ManagedPtr MessageMetrics | |
TypedObject MessageMetrics Source # | |
Defined in GI.Soup.Structs.MessageMetrics | |
HasParentTypes MessageMetrics Source # | |
Defined in GI.Soup.Structs.MessageMetrics | |
IsGValue (Maybe MessageMetrics) Source # | Convert |
Defined in GI.Soup.Structs.MessageMetrics gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe MessageMetrics -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe MessageMetrics) | |
type ParentTypes MessageMetrics Source # | |
Defined in GI.Soup.Structs.MessageMetrics |
Methods
Click to display all available methods, including inherited ones
Methods
Getters
getConnectEnd, getConnectStart, getDnsEnd, getDnsStart, getFetchStart, getRequestBodyBytesSent, getRequestBodySize, getRequestHeaderBytesSent, getRequestStart, getResponseBodyBytesReceived, getResponseBodySize, getResponseEnd, getResponseHeaderBytesReceived, getResponseStart, getTlsStart.
Setters
None.
copy
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m MessageMetrics | Returns: a copy of |
Copies metrics
.
free
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m () |
Frees metrics
.
getConnectEnd
messageMetricsGetConnectEnd Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the connection end time |
Get the time immediately after the [classmessage
] 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).
getConnectStart
messageMetricsGetConnectStart Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the connection start time |
Get the time immediately before the [classmessage
] started to
establish the connection to the server.
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).
getDnsEnd
messageMetricsGetDnsEnd Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the domain lookup end time |
Get the time immediately after the [classmessage
] completed the
domain lookup name for the resource.
It will be 0 if no domain lookup was required to fetch the resource (a persistent connection was used or resource was loaded from the local disk cache).
getDnsStart
messageMetricsGetDnsStart Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the domain lookup start time |
Get the time immediately before the [classmessage
] started the
domain lookup name for the resource.
It will be 0 if no domain lookup was required to fetch the resource (a persistent connection was used or resource was loaded from the local disk cache).
getFetchStart
messageMetricsGetFetchStart Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the fetch start time |
Get the time immediately before the [classmessage
] started to
fetch a resource either from a remote server or local disk cache.
getRequestBodyBytesSent
messageMetricsGetRequestBodyBytesSent Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the request body bytes sent |
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
[methodmessageMetrics
.get_request_body_size]. This value is available right
before signalmessage
[wroteBody] signal is emitted, but you might get an
intermediate value if called before.
getRequestBodySize
messageMetricsGetRequestBodySize Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the request body size |
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 signalmessage
[wroteBody] signal is
emitted, but you might get an intermediate value if called before.
getRequestHeaderBytesSent
messageMetricsGetRequestHeaderBytesSent Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the request headers bytes sent |
Get the number of bytes sent to the network for the request headers.
This value is available right before signalmessage
[wroteHeaders] signal
is emitted, but you might get an intermediate value if called before.
getRequestStart
messageMetricsGetRequestStart Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the request start time |
Get the time immediately before the [classmessage
] started the
request of the resource from the server or the local disk cache.
getResponseBodyBytesReceived
messageMetricsGetResponseBodyBytesReceived Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the response body bytes received |
Get the number of bytes received from the network for the response body.
This value is available right before signalmessage
[gotBody] 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.
getResponseBodySize
messageMetricsGetResponseBodySize Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the response body size |
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
[methodmessageMetrics
.get_response_body_bytes_received]. This value is
available right before signalmessage
[gotBody] signal is emitted, but you
might get an intermediate value if called before.
getResponseEnd
messageMetricsGetResponseEnd Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the response end time |
Get the time immediately after the [classmessage
] received the last
bytes of the response from the server or the local disk cache.
In case of load failure, this returns the time immediately before the fetch is aborted.
getResponseHeaderBytesReceived
messageMetricsGetResponseHeaderBytesReceived Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the response headers bytes received |
Get the number of bytes received from the network for the response headers.
This value is available right before signalmessage
[gotHeaders] 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.
getResponseStart
messageMetricsGetResponseStart Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the response start time |
Get the time immediately after the [classmessage
] received the first
bytes of the response from the server or the local disk cache.
getTlsStart
messageMetricsGetTlsStart Source #
:: (HasCallStack, MonadIO m) | |
=> MessageMetrics |
|
-> m Word64 | Returns: the tls start time |
Get the time immediately before the [classmessage
] started the
TLS handshake.
It will be 0 if no TLS handshake was required to fetch the resource (connection was not secure, a persistent connection was used or resource was loaded from the local disk cache).