Virtuozzo Virtualization SDK C API Reference
Subscribes to receive the specified virtual machine performance statistics on a periodic basis.
To obtain statistics, an event handler (callback function) is required. Within the event handler, first check the type of event. Events of type PET_DSP_EVT_VM_STATISTICS_UPDATED indicate an event containing performance data. To access the statistics handle (a handle of type PHT_SYSTEM_STATISTICS), first extract the event parameter using PrlEvent_GetParam, then convert the result (which will be a handle to an object of type PHT_EVENT_PARAMETER) to a handle using PrlEvtPrm_ToHandle. The functions that operate on PHT_SYSTEM_STATISTICS references can then be used to obtain statistics data.
For the event handler to be called, it is necessary to register it with PrlVm_RegEventHandler. When statistics data is no longer required, unsubscribe from statistics events using PrlVm_UnsubscribeFromGuestStatistics. When events are no longer required, unregister the event handler using PrlVm_UnregEventHandler.
PRL_ERR_INVALID_ARG - invalid handle was passed.
PRL_ERR_SUCCESS - function completed successfully.