Skip to content

Commit 01644dc

Browse files
sp_PressureDetector: filter out zero-rate perfmon counters
Rows with cntr_value = 0 are now excluded at insert into the table variable, and rows where total_per_second rounds to 0 via integer division are filtered from the result set. Reduces noise when reviewing perfmon stats on long-uptime servers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6e717dd commit 01644dc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

sp_PressureDetector/sp_PressureDetector.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,8 @@ OPTION(MAXDOP 1, RECOMPILE);',
20562056
p.cntr_value,
20572057
p.cntr_type
20582058
FROM p
2059-
WHERE p.object_name LIKE @prefix
2059+
WHERE p.cntr_value > 0
2060+
AND p.object_name LIKE @prefix
20602061
AND p.instance_name NOT IN
20612062
(
20622063
N'internal', N'master', N'model', N'msdb', N'model_msdb',
@@ -2125,7 +2126,7 @@ OPTION(MAXDOP 1, RECOMPILE);',
21252126
p.total,
21262127
p.total_per_second
21272128
FROM p
2128-
WHERE p.cntr_value > 0
2129+
WHERE p.total_per_second <> N'0'
21292130
ORDER BY
21302131
p.object_name,
21312132
p.counter_name,

0 commit comments

Comments
 (0)