Skip to content

Add 14 perfmon counters to sp_PressureDetector #682

@erikdarlingdata

Description

@erikdarlingdata

Summary

Add 14 additional perfmon counters to sp_PressureDetector's dm_os_performance_counters IN clause. All are 65792 or 272696576 cntr_type — no code changes needed beyond extending the list. These are being added to PerformanceMonitor as well (erikdarlingdata/PerformanceMonitor#255).

Counters to Add

65792 (raw count):

  • Version Store Size (KB)
  • Free Space in tempdb (KB)
  • Active Temp Tables
  • Processes blocked

272696576 (cumulative/rate):

  • Full Scans/sec
  • Index Searches/sec
  • Page Splits/sec
  • Free list stalls/sec
  • Workfiles Created/sec
  • Worktables Created/sec
  • Temp Tables Creation Rate
  • Version Generation rate (KB/s)
  • Version Cleanup rate (KB/s)
  • Lock Timeouts/sec

Implementation

Just add to the IN clause at the existing dm_os_performance_counters query. No cntr_type branching, delta calculations, or output formatting changes needed — the existing logic handles both counter types correctly.

Note

The existing WHERE p.cntr_value > 0 filter will suppress gauge counters (65792) when their value is zero. This is acceptable — e.g., Processes blocked = 0 and Version Store Size = 0 aren't interesting to report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions