Documentation
UC_GetEventStatistics
array UC_GetEventStatistics (int $InstanceID)
Parameters
| InstanceID | ID for the Util Control |
Returns
An array with the following key => value pairs:
| Index | Type | Description |
|---|---|---|
| CyclicUpdateCount | integer | Number of updates of cyclic events and weekly schedules |
| TriggerUpdateCount | integer | Number of executions of triggered events |
Description
The function evaluates the message EM_UPDATE, which an event sends after each execution and on each recalculation of its next run time, and assigns it by the type of the event. Triggered events only send the message when they are executed, so TriggerUpdateCount counts their executions. Cyclic events and weekly schedules count towards CyclicUpdateCount, also when their next run time is recalculated without an execution, e.g. when they are activated, deactivated or their schedule is changed.
If one of the values grows strongly between two queries, a very large number of events is executed, e.g. triggered events on a variable that is updated very frequently. The values are summed up in memory since the start of IP-Symcon and cannot be reset (only a restart starts again at 0).
The ID of the Util Control instance can be determined e.g. with IPS_GetInstanceListByModuleID and the module GUID {B69010EA-96D5-46DF-B885-24821B8C8DBD}. If InstanceID does not exist, the function fails with "Instance #... does not exist", if the instance belongs to another module, with "Instance does not implement this function".
Example
// Determine the ID of the Util Control instance
$id = IPS_GetInstanceListByModuleID('{B69010EA-96D5-46DF-B885-24821B8C8DBD}')[0];
print_r(UC_GetEventStatistics($id));
/* e.g. returns:
Array
(
[CyclicUpdateCount] => 0
[TriggerUpdateCount] => 0
)
*/