ndejong / pfsense_fauxapi

REST based API interface for pfSense 2.3.x and 2.4.x to facilitate devops
Apache License 2.0
354 stars 61 forks source link

Question : system_stats > cpu value ? #62

Closed oasisck closed 4 years ago

oasisck commented 4 years ago

Hello, I just wanna know what values report "cpu" in system_stats

{
  "callid": "5b3b511655589",
  "action": "system_stats",
  "message": "ok",
  "data": {
    "stats": {
      "cpu": "20770421|20494981",

Thanks for your wonderful API

ndejong commented 4 years ago

Good question, this comes from the pfSense cpu_usage() function itself that you can see here:- https://github.com/pfsense/pfsense/blob/master/src/usr/local/www/includes/functions.inc.php#L84

The comment there states:- """ Returns the current total ticks and user ticks. The dashboard widget calculates the load from that """

Reading the pfSense code is seems that the first value is the sum of the CPU usage and the second value is the CPU idle time