File: libvirt-domain-interface-stats.xml

package info (click to toggle)
libvirt-php 0.5.2~30-g64dca6f-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,460 kB
  • ctags: 5,538
  • sloc: cpp: 11,159; ansic: 8,250; xml: 3,999; php: 1,604; sh: 580; makefile: 189; perl: 97
file content (146 lines) | stat: -rw-r--r-- 4,305 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?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
-->