Collapse All
Parallels Virtualization SDK
ContentsIndex
PreviousUpNext
PrlSrv_SubscribeToPerfStats Function
PHT_SERVER

Allows to subscribe to periodically receive perfomance statistics.

Syntax
PRL_HANDLE PrlSrv_SubscribeToPerfStats(
    PRL_HANDLE hServer, 
    PRL_CONST_STR sFilter
);
File

PrlApiStat.h

Parameters

hServer
A handle of type PHT_SERVER identifying the Parallels Service.
sFilter
String representing statistics filter, use char '*' at the end to get subset of statistic. Could be NULL, to get all statistic. See PrlPerfCounters.h header file in order to determine published performance counters patterns list.

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_PERFSTATS_UPDATED 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 PrlSrv_UnsubscribeFromHostPerfStats. When events are no longer required, unregister the event handler using PrlSrv_UnregEventHandler

If method is called more than once, the 'filter' value is updated each time on the Parallels 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
© 2021 Parallels International GmbH. All rights reserved.