« Back to Product

Documentation

IPS_GetMediaStats

 array IPS_GetMediaStats ()

Returns

An array with the following key => value pairs:

Index Type Description
Count integer Number of media objects whose content is cached in memory
TotalBytes integer Estimated memory usage of all media objects including the cached contents in bytes

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 memory usage of the media objects. Count only counts the media objects whose content (Base64 encoded) is cached in memory, e.g. media objects with an active cache. TotalBytes additionally contains the management data of all media objects such as file name and checksum.

The bytes are an estimate of the occupied memory based on the stored data structures and not an exact measurement. The value is also recorded in the series "Medias" of IPS_GetStatsHistory.

Example

// Output the memory usage of the media objects
print_r(IPS_GetMediaStats());

/* e.g. returns:
Array
(
    [Count] => 3
    [TotalBytes] => 262144
)
*/
Any questions?