Skip to main content

Get System Metrics

GET /api/queue/metrics Returns current system metrics collected via psutil and macOS CLI tools.
cURL
curl http://localhost:60534/api/queue/metrics

Response

200 Success
{
  "metrics": {
    "battery_level": 72,
    "power_source_plugged": true,
    "cpu_percent": 34.5,
    "cpu_idle_seconds": 300.0,
    "cpu_temperature": null,
    "fan_speed": null,
    "collected_at": 1705312200.0
  }
}

Metric Fields

FieldTypeDescription
battery_levelnumber | nullBattery percentage (0-100), null if no battery
power_source_pluggedboolean | nullWhether AC power is connected
cpu_percentnumber | nullCPU usage percentage
cpu_idle_secondsnumber | nullSeconds since last significant CPU activity
cpu_temperaturenumber | nullCPU temperature in Celsius (macOS only, requires osx-cpu-temp)
fan_speednumber | nullFan speed in RPM (macOS only, requires istats)
collected_atnumberUnix timestamp when metrics were collected
Temperature and fan speed require optional macOS CLI tools (osx-cpu-temp, istats). They return null if unavailable.