« Back to Product

Documentation

IPS_GetStatsHistory

 string IPS_GetStatsHistory ()

Returns

JSON encoded array with one entry per hour (directly as array via the JSON-RPC interface). Each entry contains the following key => value pairs:

Index Type Description
TimeStamp integer Unix timestamp of the beginning of the hour
array For each recorded series an array with the keys Count and Bytes, each containing Min, Max and Avg (minimum, maximum and average of the hour)

Series

Series Count Bytes
WorkingSet Number of handles of the process Occupied memory (working set) of the process
Shared Number of threads of the process Shareable memory (executable, libraries, OPcache)
Allocator mimalloc: abandoned pages, otherwise 0 Memory occupied by the allocator (mimalloc/jemalloc only, otherwise 0)
Traces see IPS_GetTraceStats see IPS_GetTraceStats
SnapshotRingBuffer see IPS_GetSnapshotRingBufferStats see IPS_GetSnapshotRingBufferStats
SnapshotBuffer see IPS_GetSnapshotBufferStats (hourly) see IPS_GetSnapshotBufferStats (hourly)
Settings see IPS_GetSettingsStats (hourly) see IPS_GetSettingsStats (hourly)
ScriptEngine see IPS_GetThreadStats see IPS_GetThreadStats
Medias see IPS_GetMediaStats see IPS_GetMediaStats
Variables see IPS_GetVariableStats see IPS_GetVariableStats
Instances see IPS_GetInstanceStats see IPS_GetInstanceStats
VideoServer Reserved, currently 0 Reserved, currently 0

Description

Warning

This function is intended for internal use only and may change or be removed at any time without notice.

The function returns the hourly aggregated history of the memory statistics of the last 7 days, e.g. for the display in the console. As long as IP-Symcon is fully started, the statistics are sampled once per minute and aggregated to minimum, maximum and average per hour. Expensive series ("SnapshotBuffer" and "Settings") are only sampled once per hour, there all three values are equal. Series without a sample in an hour are missing in the respective entry.

The history is only kept in memory and is empty after a restart of IP-Symcon. At most 168 entries (7 days) are kept, the current entry is the last one in the array.

Warning

In PHP the function returns the history as JSON encoded string which can be evaluated with json_decode. Via the JSON-RPC interface the history is returned directly as array.

All values in Bytes are specified in bytes. The number of series and their meaning may change with new versions.

Example

// Output the memory of the last hours
$history = json_decode(IPS_GetStatsHistory(), true);
foreach (array_slice($history, -3) as $hour) {
    printf("%s: %.1f MB (max. %.1f MB)\n", date('Y-m-d H:i', $hour['TimeStamp']), $hour['WorkingSet']['Bytes']['Avg'] / 1048576, $hour['WorkingSet']['Bytes']['Max'] / 1048576);
}

/* e.g. returns:
2026-09-26 10:00: 182.4 MB (max. 190.1 MB)
2026-09-26 11:00: 184.0 MB (max. 188.7 MB)
2026-09-26 12:00: 183.2 MB (max. 185.9 MB)
*/
Any questions?