Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
SystemInfo.CPULoad
Queries system load statistics.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
SystemInfo | 10.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |
Parameters
none
Result
Returns JSON or error.
Description
Queries system load statistics.Returns a JSON with entries for system, user and idle. Those counters count up, so you may need to query several times and check deltas.
Examples
Query system load on macOS:
MBS( "SystemInfo.CPULoad" )
Example result:
{
"system" : 54822806,
"nice" : 0,
"idle" : 1143567712,
"user" : 78572673
}
Query CPU Load:
Let(
[
// query load
r1 = MBS( "SystemInfo.CPULoad" );
// separate values
system1 = JSONGetElement ( r1; "system" );
idle1 = JSONGetElement ( r1; "idle" );
user1 = JSONGetElement ( r1; "user" );
total1 = user1+idle1+user1;
// make a 0.5 second pause
t = MBS("Time.Sleep"; 500);
// now query again
r2 = MBS( "SystemInfo.CPULoad" );
// separate values
system2 = JSONGetElement ( r2; "system" );
idle2 = JSONGetElement ( r2; "idle" );
user2 = JSONGetElement ( r2; "user" );
total2 = user2+idle2+user2;
// calculate deltas
deltaTotal = total2 - total1;
deltaSystem = system2 - system1;
deltaIdle = idle2 - idle1;
deltaUser = user2 - user1;
// and calculate the percentage used
load = (deltaSystem+deltaUser) / deltaTotal
]; load)
See also
Release notes
- Version 10.5
- Added SystemInfo.CPULoad function.
Blog Entries
- New in MBS FileMaker Plugin 10.5
- Neues MBS FileMaker Plugin 10.5 - Über 6400 Funktionen in einem Plugin
- MBS FileMaker Plugin 10.5 - More than 6400 Functions In One Plugin
- MBS FileMaker Plugin, version 10.5pr4
FileMaker Magazin
This function is free to use.
Created 12nd October 2020, last changed 28th January 2023
