Skip to content

Lite: surface total non-idle CPU + alert toggle (closes #899)#902

Merged
erikdarlingdata merged 1 commit intodevfrom
feature/899-total-non-idle-cpu-alert
Apr 28, 2026
Merged

Lite: surface total non-idle CPU + alert toggle (closes #899)#902
erikdarlingdata merged 1 commit intodevfrom
feature/899-total-non-idle-cpu-alert

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Overview cards now show total non-idle CPU prominently with the SQL-only value alongside (e.g. `64% (SQL 60%)`).
  • New `CpuAlertMode` enum (Total / SqlOnly, default Total) drives both the alert evaluator and the headline color.
  • Settings → Alerts has a new "measured as" dropdown next to the CPU threshold.
  • Tray notifications and email alerts label the value as "Total CPU" or "SQL CPU" so it's clear which metric tripped.

The data was already collected (`sqlserver_cpu_utilization` + `other_process_cpu_utilization`); this is a presentation/alert-layer change only — no schema, no new collection. Dashboard mirror is a follow-up.

Test plan

  • Build clean.
  • Visual check on Overview cards: shows e.g. "64% (SQL 60%)" when both values present, falls back to single number otherwise.
  • Visual check on Settings → "measured as" dropdown; saves and restores from settings.json.
  • Trigger a real alert (set threshold low) and verify the tray notification + email use the correct "Total CPU" / "SQL CPU" label and value.

Closes #899.

The CPU alert and headline previously only used SQL Server's scheduler
ProcessUtilization, which answers "how busy are SQL's schedulers" — not
"is the box in trouble." On a noisy host that distinction matters.

Changes (Lite):
- Overview cards now show total non-idle CPU prominently with the SQL
  number alongside, e.g. "64% (SQL 60%)". Color tracks the alert metric.
- New CpuAlertMode enum (Total / SqlOnly), default Total. Settings has a
  "measured as" dropdown next to the CPU threshold.
- Alert evaluator and tray notifications use CpuPercentForAlert and label
  the value as "Total CPU" or "SQL CPU" so users know which metric tripped.
- Persists alert_cpu_mode in settings.json.

No data model or schema changes — sqlserver_cpu_utilization and
other_process_cpu_utilization were already collected; only the
presentation/alert layer needed work. Dashboard mirror is a follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 5f0248e into dev Apr 28, 2026
3 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/899-total-non-idle-cpu-alert branch April 28, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant