Collapse All
Virtuozzo Virtualization SDK C API Reference
ContentsIndex
PreviousUpNext
PrlVm_SubscribeToPerfStats Function
PHT_VIRTUAL_MACHINE

Allows to subscribe to periodicaly receive virtual machine perfomance statistics.

Syntax
PRL_HANDLE PrlVm_SubscribeToPerfStats(
    PRL_HANDLE hVm, 
    PRL_CONST_STR sFilter
);
File

PrlApiVm.h

Parameters

hVm
A handle of type PHT_VIRTUAL_MACHINE identifying the virtual machine.
sFilter
String representing statistics filter, use char '*' at the end to get subset of statistic. Could be NULL, to get all statistic.

Returns

A handle of type PHT_JOB containing the results of this asynchronous operation or PRL_INVALID_HANDLE if there's not enough memory to instantiate the job object.

Remarks

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_PERFSTATS indicate an event containing statistics data. The perfomace statistics repesented by parameters of Event object (a handle of type PHT_EVENT). 

For the event handler to be called, it is necessary to register it with PrlSrv_RegEventHandler. When statistics data is no longer required, unsubscribe from statistics events using PrlVm_UnsubscribeFromHostPerfStats. When events are no longer required, unregister the event handler using PrlVm_UnregEventHandler

If method is called mutliple times, the 'filter' value is updated each time on the Virtuozzo Service side. 

To get the return code from the PHT_JOB object, use the PrlJob_GetRetCode function. Possible values are: 

PRL_ERR_INVALID_ARG - invalid handle was passed. 

PRL_ERR_SUCCESS - function completed successfully. 

Links
Copyright ©2016-2017 Parallels International GmbH. All rights reserved.