libvirt_domain_interface_stats provide interface statistics for the virtual network interface on domain.
&reftitle.description; array libvirt_domain_interface_stats resource domain string path

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.

The returned array contains members in accoridng to the libvirt structure virDomainInterfaceStatsStruct.

Members of the array returned by libvirt_domain_interface_stats

rx_bytes | Bytes received
rx_packets | Packets received
rx_errs | Errors on receive
rx_drop | Drops on receive
rx_bytes | Bytes transmitted
rx_packets | Packets transmitted
rx_errs | Errors on transmit
rx_drop | Drops on transmit

Warning

. This function returns values that may be bigger than 32bit integer limit. Please read this note for more details.

&reftitle.parameters;

domain

  Domain resource of domain the interface is attached to

path

  Path to the interface, i.e. "vnet1"

&reftitle.returnvalues;

Array with statistics.

&reftitle.examples;

`libvirt_domain_interface_stats` example

Get interface statistics on interface vnet1 on domain test

    <?php
    	$dom=libvirt_domain_lookup_by_name($res,"test");
    	print_r(libvirt_domain_interface_stats($dom,"vnet1"));
    ?>

&example.outputs.similar;

    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
    )

&reftitle.seealso;

- `libvirt_domain_memory_stats`
- `libvirt_domain_block_stats`