mirror of
https://github.com/php/pecl-virtualization-libvirt.git
synced 2026-04-28 17:23:17 +02:00
147 lines
4.2 KiB
XML
147 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision: 1.28 $ -->
|
|
|
|
<refentry xml:id="function.libvirt-domain-interface-stats" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>libvirt_domain_interface_stats</refname>
|
|
<refpurpose>provide interface statistics for the virtual network interface on domain.</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>libvirt_domain_interface_stats</methodname>
|
|
<methodparam ><type>resource</type><parameter>domain</parameter></methodparam>
|
|
<methodparam ><type>string</type><parameter>path</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function returns network interface stats for interfaces attached to the domain. The path parameter is the name of the network interface. Domains may have more than one network interface. To get stats for each you should make multiple calls to this function. Individual fields within the stats structure may be returned as -1, which indicates that the hypervisor does not support that particular statistic.
|
|
</para>
|
|
<para>
|
|
The returned array contains members in accoridng to the libvirt structure virDomainInterfaceStatsStruct.
|
|
<table frame='all'><title>Members of the array returned by libvirt_domain_interface_stats</title>
|
|
<tgroup cols='2'>
|
|
<tbody>
|
|
<row><entry>rx_bytes</entry><entry>Bytes received</entry></row>
|
|
<row><entry>rx_packets</entry><entry>Packets received</entry></row>
|
|
<row><entry>rx_errs</entry><entry>Errors on receive</entry></row>
|
|
<row><entry>rx_drop</entry><entry>Drops on receive</entry></row>
|
|
<row><entry>rx_bytes</entry><entry>Bytes transmitted</entry></row>
|
|
<row><entry>rx_packets</entry><entry>Packets transmitted</entry></row>
|
|
<row><entry>rx_errs</entry><entry>Errors on transmit</entry></row>
|
|
<row><entry>rx_drop</entry><entry>Drops on transmit</entry></row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
<note><title>Warning</title>
|
|
<para>.
|
|
This function returns values that may be bigger than 32bit integer limit. Please read this <link linkend="libvirt.longlong">note</link> for more details.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>domain</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Domain resource of domain the interface is attached to
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>path</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Path to the interface, i.e. "vnet1"
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<!-- See also &return.success; -->
|
|
<para>
|
|
Array with statistics.
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>libvirt_domain_interface_stats</function> example</title>
|
|
<para>
|
|
Get interface statistics on interface vnet1 on domain test
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$dom=libvirt_domain_lookup_by_name($res,"test");
|
|
print_r(libvirt_domain_interface_stats($dom,"vnet1"));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[rx_bytes] => 94699317
|
|
[rx_packets] => 794389
|
|
[rx_errs] => 0
|
|
[rx_drop] => 0
|
|
[tx_bytes] => 0
|
|
[tx_packets] => 0
|
|
[tx_errs] => 0
|
|
[tx_drop] => 0
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>libvirt_domain_memory_stats</function></member>
|
|
<member><function>libvirt_domain_block_stats</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|
|
|