<refsect1>
<title>Functions</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><tbody>
<row><entry><returnvalue>SoupMessageMetrics</returnvalue> *
</entry><entry>soup_message_metrics_copy <phrase>()</phrase></entry></row><row><entry><returnvalue>void</returnvalue>
</entry><entry>soup_message_metrics_free <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_fetch_start <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_dns_start <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_dns_end <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_connect_start <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_connect_end <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_tls_start <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_request_start <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_response_start <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_response_end <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_request_header_bytes_sent <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_request_body_size <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_request_body_bytes_sent <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_response_header_bytes_received <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_response_body_size <phrase>()</phrase></entry></row><row><entry><returnvalue>guint64</returnvalue>
</entry><entry>soup_message_metrics_get_response_body_bytes_received <phrase>()</phrase></entry></row>
</tbody>
</tgroup>
</informaltable>
</refsect1><refsect1>
<title>Types and Values</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><tbody>
<row><entry></entry><entry>SoupMessageMetrics</entry></row>
</tbody>
</tgroup>
</informaltable>
</refsect1><refsect1>
<title>Object Hierarchy</title><screen> GBoxed<phrase>╰──</phrase> SoupMessageMetrics
</screen>
</refsect1><refsect1><title>Includes</title><synopsis>#include <libsoup/soup.h>
</synopsis></refsect1><refsect1>
<title>Description</title><para>Metrics collected while loading a <type>SoupMessage</type>.</para><para>Metrics are not collected by default for a <type>SoupMessage</type>, you need to add the
flag <literal>SOUP_MESSAGE_COLLECT_METRICS</literal> to enable the feature.</para>
</refsect1><refsect1>
<title>Functions</title><refsect2>
<title>soup_message_metrics_copy ()</title><programlisting><returnvalue>SoupMessageMetrics</returnvalue> *
soup_message_metrics_copy (<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Copies <parameter>metrics</parameter>
.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> a copy of <parameter>metrics</parameter>
</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_free ()</title><programlisting><returnvalue>void</returnvalue>
soup_message_metrics_free (<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Frees <parameter>metrics</parameter>
</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_fetch_start ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_fetch_start (<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the time immediately before the <type>SoupMessage</type> started to
fetch a resource either from a remote server or local disk cache.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the fetch start time</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_dns_start ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_dns_start (<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the time immediately before the <type>SoupMessage</type> 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).</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the domain lookup start time</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_dns_end ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_dns_end (<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the time immediately after the <type>SoupMessage</type> 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).</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the domain lookup end time</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_connect_start ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_connect_start
(<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the time immediately before the <type>SoupMessage</type> 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).</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the connection start time</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_connect_end ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_connect_end (<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the time immediately after the <type>SoupMessage</type> 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).</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the connection end time</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_tls_start ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_tls_start (<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the time immediately before the <type>SoupMessage</type> 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).</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the tls start time</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_request_start ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_request_start
(<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the time immediately before the <type>SoupMessage</type> started the
request of the resource from the server or the local disk cache.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the request start time</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_response_start ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_response_start
(<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the time immediately after the <type>SoupMessage</type> received the first
bytes of the response from the server or the local disk cache.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the response start time</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_response_end ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_response_end (<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the time immediately after the <type>SoupMessage</type> 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.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the response end time</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_request_header_bytes_sent ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_request_header_bytes_sent
(<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the number of bytes sent to the network for the request headers.
This value is available right before <type>“wrote-headers”</type> signal
is emitted, but you might get an intermediate value if called before.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the request headers bytes sent</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_request_body_size ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_request_body_size
(<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>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 <type>“wrote-body”</type> signal is emitted, but you might get
an intermediate value if called before.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the request body size</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_request_body_bytes_sent ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_request_body_bytes_sent
(<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>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 <function>soup_message_metrics_get_request_body_size()</function>.
This value is available right before <type>“wrote-body”</type> signal is
emitted, but you might get an intermediate value if called before.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the request body bytes sent</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_response_header_bytes_received ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_response_header_bytes_received
(<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the number of bytes received from the network for the response headers.
This value is available right before <type>“got-headers”</type> 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.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the response headers bytes received</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_response_body_size ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_response_body_size
(<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>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 <function>soup_message_metrics_get_response_body_bytes_received()</function>. This value is
available right before <type>“got-body”</type> signal is emitted, but you might get
an intermediate value if called before.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the response body size</para>
</refsect3></refsect2><refsect2>
<title>soup_message_metrics_get_response_body_bytes_received ()</title><programlisting><returnvalue>guint64</returnvalue>
soup_message_metrics_get_response_body_bytes_received
(<parameter><type>SoupMessageMetrics</type> *metrics</parameter>);</programlisting><para>Get the number of bytes received from the network for the response body. This value is
available right before <type>“got-body”</type> 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.</para><refsect3>
<title>Parameters</title><informaltable>
<tgroup>
<colspec></colspec><colspec></colspec><colspec></colspec><tbody>
<row><entry><para>metrics</para></entry><entry><para>a <type>SoupMessageMetrics</type></para></entry><entry></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3>
<title>Returns</title><para> the response body bytes received</para>
</refsect3></refsect2>
</refsect1><refsect1>
<title>Types and Values</title><refsect2>
<title>SoupMessageMetrics</title><programlisting>typedef struct _SoupMessageMetrics SoupMessageMetrics;</programlisting><para>SoupMessageMetrics contains metrics collected while loading a <type>SoupMessage</type>
either from the network or the disk cache.</para><para>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.</para><para>Size metrics are expressed in bytes and aree updated while the <type>SoupMessage</type> is
being loaded. You can connect to different <type>SoupMessage</type> signals to get the
final result of every value.</para>
</refsect2>
</refsect1><refsect1>
<title>See Also</title><para><type>SoupMessage</type></para>
</refsect1>
</refentry>