Skip to main content

Health

Health events are a special type of optional events that collect information about the device and general performance metrics. Enabling health events such as the SDK Init Event and the Performance Event will offer more insight. They are all off by default.

You can enable each of them in two ways:

  • In the [gameanalytics] section of game.project. The settings are applied before the SDK starts, so this is the recommended way.
  • From Lua, if your game uses manual initialization (manual_initialize = 1). Call the functions before gameanalytics.initialize().
info

On web builds the JavaScript SDK has a single switch for all health events: enabling any one of them enables all of them.

Hardware Tracking​

While not being a separate event, enabling hardware tracking will attach additional information about the device to health events.

[gameanalytics]
enable_health_hardware_info = 1

Or from Lua, before gameanalytics.initialize():

gameanalytics.enableHealthHardwareInfo(true)
NameDescription
cpu_modelName of the CPU
hardwareDevice's chipset
cpu_num_coresTotal number of physical CPU cores
resolutionResolution of the device as a string, e.g: "WidthXHeight"
memory_sys_total*Total system memory expressed in MB
memory_sys_used*Memory used by the whole system at the time of the reading, expressed in MB
memory_app_used*Memory used by the app alone at the time of the reading, expressed in MB

(*) Requires memory tracking to be enabled.

SDK Init Event​

The SDK init event is sent every time the app is starting and loading into memory for the first time, not when users return and resume an in-memory game.

[gameanalytics]
enable_sdk_init_event = 1

Or from Lua, before gameanalytics.initialize():

gameanalytics.enableSDKInitEvent(true)

App Boot Time​

The SDK init event will also track the app boot time, this is defined as the time between the start of the game (e.g: the process) to the moment that GameAnalytics is initialized.

tip

To better measure start-up times, enable manual_initialize = 1 and call gameanalytics.initialize() once the game has loaded its resources.

Performance Event​

If enabled, the performance event will collect performance metrics during the playtime session. This event will be automatically sent at the end of the session.

FPS Tracking​

If enabled, GameAnalytics will automatically record the averaged FPS values every second across the play session. The values will be sent at the end of every session as part of the Performance event.

There is no FPS tracker to write: the extension measures the game's frame rate itself.

[gameanalytics]
enable_fps_histogram = 1

Or from Lua, before gameanalytics.initialize():

gameanalytics.enableFpsHistogram(true)
info

The FPS event maximum value will be capped to 120 FPS, all values higher than 120 FPS will be reported as 120.

NameDescription
fps_data_tableGameAnalytics will automatically record the averaged FPS value every second and aggregate the values into buckets from 0 to 120 each corresponding to an FPS value (e.g: bucket #60 contains the number of 60fps samples)

Memory Tracking​

If enabled, GameAnalytics will automatically record memory consumption across the play session. The values will be sent at the end of every session as part of the Performance event.

Every 5 seconds, GameAnalytics will query the total memory used by the device and total memory used by the application alone. Those will be stored as percentages of total device memory.

[gameanalytics]
enable_memory_histogram = 1

Or from Lua, before gameanalytics.initialize():

gameanalytics.enableMemoryHistogram(true)
NameDescription
mem_sys_data_tableMemory usage across the whole system expressed in percents of the total device memory
memory_app_data_tableMemory usage of the application alone expressed in percents of the total device memory
tip

For more information about the Health dashboard go here.