fusion44 / blitz_api

A management backend for the RaspiBlitz project written in Python / FastAPI
MIT License
19 stars 18 forks source link

hardware_info event: cpu_overall_percent is a misleading field name #79

Open cstenglein opened 2 years ago

cstenglein commented 2 years ago

Currently, blitz_api sends the following hardware_info event:

{
  "cpu_overall_percent": 1.87,
  "cpu_per_cpu_percent": [1.77, 1.91, 1.92],
  "vram_total_bytes": 3844000000,
  "vram_available_bytes": 2587000000,
  "vram_used_bytes": 1257000000,
  "vram_usage_percent": 32.7,
  "temperatures_celsius": { "system_temp": 56.0, "coretemp": [] },
  "boot_time_timestamp": 1650185397.5461075,
  "disks": [
    {
      "device": "/",
      "mountpoint": "/",
      "filesystem_type": "ext4",
      "partition_total_bytes": 1000203820544,
      "partition_used_bytes": 572113763840,
      "partition_free_bytes": 428090056704,
      "partition_percent": 42.8
    }
  ],
  "networks": {
    "internet_online": "xxx",
    "tor_web_addr": "xxx",
    "internet_localip": "xxx",
    "internet_localiprange": "xxx"
  }
}

cpu_overall_percent is not the percentage of the CPU, but the load. cpu_per_cpu_percent are the load averages in the last minute, last 5min, last 15min

See also https://scoutapm.com/blog/understanding-load-averages

Suggestion: rename the fields, I'll do the correct conversion in frontend :)