Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

SystemInfo.AppResourceUsageStatistics

Queries application resource usage statistics for current application.

Component Version macOS Windows Linux Server iOS SDK
SystemInfo 15.3 ✅ Yes ❌ No ❌ No ✅ Yes, on macOS ❌ No
MBS( "SystemInfo.AppResourceUsageStatistics" { ; Version } )   More

Parameters

Parameter Description Example Flags
Version The version of info requested.
Default is version 6 with all information.
You can pass lower number if you need less information.
6 Optional

Result

Returns JSON or error.

Description

Queries application resource usage statistics for current application.
The SystemInfo.AppResourceUsageStatistics function is a macOS-specific function that retrieves detailed resource usage statistics for the current process.

It fills a versioned rusage info structure with metrics such as CPU time, memory footprint, disk I/O, and energy usage. This API is part of the libproc library and allows fine-grained performance monitoring, including per-QoS and power-weighted data, not available through standard POSIX interfaces. Our plugin returns this as JSON.

FieldVersionDescription
uuid0UUID of the process
user_time0User CPU time in nanoseconds
system_time0System CPU time in nanoseconds
pkg_idle_wkups0Package idle wakeups
interrupt_wkups0Interrupt wakeups
pageins0Number of page-ins (from disk to memory)
wired_size0Wired memory size in bytes
resident_size0Resident memory size in bytes
phys_footprint0Physical memory footprint in bytes (more accurate than resident size)
proc_start_abstime0Absolute time (mach timebase) when the process started
proc_exit_abstime0Absolute time when the process exited (0 if still running)
child_user_time1Total user CPU time of child processes (nanoseconds)
child_system_time1Total system CPU time of child processes (nanoseconds)
child_pkg_idle_wkups1Package idle wakeups of children
child_interrupt_wkups1Interrupt wakeups of children
child_pageins1Page-ins by child processes
child_elapsed_abstime1Wall clock time used by child processes (absolute time units)
diskio_bytesread2Total bytes read from disk
diskio_byteswritten2Total bytes written to disk
cpu_time_qos_default3CPU time at default QoS level (nanoseconds)
cpu_time_qos_maintenance3CPU time at maintenance QoS level
cpu_time_qos_background3CPU time at background QoS level
cpu_time_qos_utility3CPU time at utility QoS level
cpu_time_qos_legacy3CPU time at legacy QoS level
cpu_time_qos_user_initiated3CPU time at user-initiated QoS level
cpu_time_qos_user_interactive3CPU time at user-interactive QoS level
billed_system_time3Billed system time (may differ from actual system time)
serviced_system_time3Actual system service time
logical_writes4Logical write calls (may be coalesced or buffered writes)
lifetime_max_phys_footprint4Max physical memory footprint reached during the process lifetime
instructions4Number of instructions executed (if supported)
cycles4Number of CPU cycles consumed (if supported)
billed_energy4Energy billed (nanojoules)
serviced_energy4Energy actually used (nJ)
interval_max_phys_footprint4Peak memory in recent sample interval
runnable_time4Time spent runnable, eg, on CPU run queue
flags5Internal status flags
user_ptime6Power-weighted user time
system_ptime6Power-weighted system time
pinstructions6Power-weighted instructions
pcycles6Power-weighted cycles
energy_nj6Total energy used (nanojoules)
penergy_nj6Power-weighted energy
secure_time_in_system6Secure system time (likely TEE/SEP-related)
secure_ptime_in_system6Power-weighted secure system time
neural_footprint6Neural engine memory used
lifetime_max_neural_footprint6Max neural footprint lifetime
interval_max_neural_footprint6Max neural footprint in interval

Examples

Query the resource usage:

Set Variable [ $json: Value: MBS( "SystemInfo.AppResourceUsageStatistics" ) ]

Example result:
{ "proc_start_abstime" : 19488832800055, "flags" : 0, "energy_nj" : 12930421197, "cycles" : 19548064738, "neural_footprint" : 0, "pageins" : 801, "system_ptime" : 18468967, "billed_system_time" : 37294579, "diskio_byteswritten" : 479232, "proc_exit_abstime" : 0, "child_user_time" : 0, "cpu_time_qos_user_interactive" : 13764390, "system_time" : 36430490, "cpu_time_qos_utility" : 109626, "child_system_time" : 0, "cpu_time_qos_legacy" : 19151865, "version" : 6, "uuid" : "C68ECD17-38FB-31DC-AA31-83B7CD11C613", "wired_size" : 0, "pkg_idle_wkups" : 142, "cpu_time_qos_background" : 401773, "runnable_time" : 183496960, "penergy_nj" : 12401806171, "child_pageins" : 0, "interval_max_neural_footprint" : 0, "serviced_system_time" : 6166545, "diskio_bytesread" : 128475136, "phys_footprint" : 588584512, "user_ptime" : 70919191, "child_interrupt_wkups" : 0, "child_elapsed_abstime" : 0, "cpu_time_qos_user_initiated" : 6066361, "cpu_time_qos_maintenance" : 0, "billed_energy" : 1512777578, "instructions" : 46808473151, "cpu_time_qos_default" : 127422445, "lifetime_max_phys_footprint" : 596039232, "interval_max_phys_footprint" : 596039232, "lifetime_max_neural_footprint" : 0, "user_time" : 130485970, "child_pkg_idle_wkups" : 0, "serviced_energy" : 66274559, "interrupt_wkups" : 3443, "resident_size" : 521551872, "pinstructions" : 39884283671, "pcycles" : 13315772972, "secure_time_in_system" : 0, "secure_ptime_in_system" : 0, "logical_writes" : 2412548 }

Check disk I/O for setting a field:

# We capture statistics before
Set Variable [ $j1 ; Value: MBS( "SystemInfo.AppResourceUsageStatistics") ]
Pause/Resume Script [ Duration (seconds): ,5 ]
#
Set Field [ Test::test ; Random ]
# Ask FileMaker to save changes
Commit Records/Requests [ With dialog: Off ]
# flush caches to make sure FileMaker does write
Flush Cache to Disk
#
# We capture statistics after
Pause/Resume Script [ Duration (seconds): ,5 ]
Set Variable [ $j2 ; Value: MBS( "SystemInfo.AppResourceUsageStatistics") ]
#
# calculate difference and show
Set Variable [ $w1 ; Value: JSONGetElement ( $j1 ; "logical_writes" ) ]
Set Variable [ $w2 ; Value: JSONGetElement ( $j2 ; "logical_writes" ) ]
Set Variable [ $d1 ; Value: JSONGetElement ( $j1 ; "diskio_byteswritten" ) ]
Set Variable [ $d2 ; Value: JSONGetElement ( $j2 ; "diskio_byteswritten" ) ]
Show Custom Dialog [ "bytes written" ; ($w2 - $w1) & " bytes logical" & ¶ & ($d2 - $d1) & " bytes written" ]

See also

Release notes

  • Version 15.3
    • Added SystemInfo.AppResourceUsageStatistics function.

Blog Entries

This function is free to use.

Created 17th June 2025, last changed 20th June 2025


SystemInfo.ADSystemInfo - SystemInfo.AppUsageStatistics