libvirt_domain_memory_stats — provide memory statistics for the domain.
This function provides memory statistics for the domain. Up to VIR_DOMAIN_MEMORY_STAT_NR elements will be populated in the returned array with memory statistics from the domain. Only statistics supported by the domain, the driver, and this version of libvirt will be returned. The array is indexed by the numerical values of appropriate constants.
|VIR_DOMAIN_MEMORY_STAT_SWAP_IN||The total amount of data read from swap space (in kb)|
|VIR_DOMAIN_MEMORY_STAT_SWAP_OUT||The total amount of memory written out to swap space (in kb)|
|VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT||The number of page faults that required disk IO to service.|
|VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT||The number of page faults serviced without disk IO.|
|VIR_DOMAIN_MEMORY_STAT_UNUSED||The amount of memory which is not being used for any purpose (in kb).|
|VIR_DOMAIN_MEMORY_STAT_AVAILABLE||The total amount of memory available to the domain's OS (in kb).|
This is the first implementation of this function in phplibvirt. There are some unsolved issues regarding integer ranges between PHP and Libvirt. We may change the beahviour of this function in future.
Note: Libvirt version
This function has been added to Libvirt in version 0.7.5. You need this or newer version of Libvirt to be able to use this function.
Domain resource of domain to get memory stats.
unused, always pass 0 (or ommit the parameter as 0 is default value
Array containig Up to VIR_DOMAIN_MEMORY_STAT_NR elements with statistics.