Skip to content

Fix PerfMon first-value spike that skews graphs#483

Merged
erikdarlingdata merged 1 commit intodevfrom
feature/fix-perfmon-spike-482
Mar 9, 2026
Merged

Fix PerfMon first-value spike that skews graphs#483
erikdarlingdata merged 1 commit intodevfrom
feature/fix-perfmon-spike-482

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Fixes [BUG] Lite - PerfMon first values spike skews graph #482
  • Added baselineOnly parameter to DeltaCalculator.CalculateDelta() — when true, the first read stores the baseline and returns 0 instead of the raw cumulative value
  • Applied to all cumulative-counter collectors: PerfMon, WaitStats, FileIO, MemoryGrants
  • Query/proc stats unchanged (single-execution queries still surface in top-N views)
  • X-axis anchoring issue was a visual side effect of the spike dominating the Y scale

Test plan

  • Start Lite, open Server > PerfMon tab
  • Verify first data point does not create a spike for any counter group
  • Verify chart scales normally after 2+ collections
  • Verify WaitStats, FileIO, MemoryGrants tabs also have no first-value spike
  • Verify Top Queries / Top Procs still show single-execution entries

🤖 Generated with Claude Code

…482)

The first collection with no baseline stored the raw cumulative DMV value
as the delta, creating a massive spike that skewed the chart Y-axis.
Added baselineOnly parameter to DeltaCalculator.CalculateDelta — when
true, the first sighting returns 0 (baseline only) instead of the raw
cumulative value. Applied to perfmon, wait stats, file I/O, and memory
grant collectors. Query/proc stats keep the existing behavior so
single-execution queries still surface in top-N views.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 92ab03e into dev Mar 9, 2026
3 checks passed
@dphugo
Copy link
Copy Markdown
Contributor

dphugo commented Mar 9, 2026

Hi @erikdarlingdata. Wow, what a rapid response! 🚀
Not sure if I should respond here or on the original Issue I raised (482) ?:

I noticed the scope was expanded to the following files, which is great:
image

However, I've picked up that _deltaCalculator.CalculateDelta is also used in:

  • Services\RemoteCollectorService.ProdecureStats.cs
  • Services\RemoteCollectorService.QueryStats.cs
image

These are currently not included in the commit and (for graphing) it does affect:

  • "Server Tab -> Queries -> Performance Trends" as can be seen in this screenshot:
image

As the scope was expanded by this commit, I figured it would makes sense to include it on this branch?
Or, because it is closed/merged, should I raise a separate bug for the above increased scope?

Kind regards,
Daniel

@erikdarlingdata
Copy link
Copy Markdown
Owner Author

Totally fine here. I can pick it up. Thanks for letting me know, as always.

@erikdarlingdata
Copy link
Copy Markdown
Owner Author

@dphugo Good catch -- query stats and procedure stats collectors now also use baselineOnly: true in PR #491, merged to dev. Thanks for flagging it!

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.

2 participants