Skip to content

Overview tab CPU chart shows SQL-only CPU while alert fires on combined CPU #1004

@erikdarlingdata

Description

@erikdarlingdata

Summary

The Overview tab's "% CPU" chart plots only sqlserver_cpu_utilization, but CPU alerts evaluate combined CPU (sqlserver_cpu_utilization + other_process_cpu_utilization). This causes user-facing confusion when an alert fires at, say, 95% but the Overview chart never shows above ~60%.

The "CPU Utilization" sub-tab correctly stacks both series, so the data is visible there — just not on the landing/Overview chart users glance at first.

Reported by a user as erikdarlingdata/PerformanceStudio#349 (filed against the wrong repo — actual code lives here).

Repro

  1. Run a workload where SQL Server CPU is ~60% and other processes consume ~30%.
  2. Set CPU alert threshold to 80%.
  3. Alert fires reporting ~90% — correct, that's combined.
  4. Open Overview tab → "% CPU" chart never exceeds ~60% → looks like the alert is bogus.
  5. Open "CPU Utilization" sub-tab → stacked chart shows the true combined total → matches the alert.

Code pointers (from exploration)

  • Alert evaluation uses combined CPU — Lite/Analysis/DuckDbFactCollector.cs ~lines 414–472 aggregates both series; Lite/Services/LocalDataService.Overview.cs ~line 190 colors CPU red on the alert metric.
  • Overview chart plots SQL-onlyDashboard/Views/ServerTab.Charts.cs ~line 475:
    dataList.Select(d => (double)d.SqlServerCpu)
    The query in Dashboard/Services/DatabaseService.ResourceMetrics.cs ~lines 230–289 already retrieves total_cpu_utilization, so the data is available — the binding just isn't using it.
  • Daily summary "High CPU Events" in Dashboard/Services/DatabaseService.Overview.cs ~lines 108–112 and ~136 also use sqlserver_cpu_utilization >= 80/90 thresholds (SQL-only). These should probably switch to total_cpu_utilization for consistency with the alert too.

Proposed fix

  1. Overview chart: plot total CPU (or stack both series like the CPU Utilization sub-tab does — Erik's call which presentation is better).
  2. High-CPU event counters in DailySummary: switch to total_cpu_utilization so they match what triggered the alerts.
  3. Verify no other UI uses SQL-only CPU in a way that implies "system CPU."

Once that ships, PerformanceStudio#349 can be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions