Skip to content

Commit

Permalink
Merge pull request #387 from erikdarlingdata/dev
Browse files Browse the repository at this point in the history
Update sp_PressureDetector.sql
  • Loading branch information
erikdarlingdata authored Mar 26, 2024
2 parents bdeab5a + 9eeb19d commit f3a9ce4
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions sp_PressureDetector/sp_PressureDetector.sql
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ OPTION(MAXDOP 1, RECOMPILE);',
(w2.hours_wait_time - w.hours_wait_time) / 1000.
),
avg_ms_per_wait =
(w2.avg_ms_per_wait - w.avg_ms_per_wait),
(w2.avg_ms_per_wait + w.avg_ms_per_wait) / 2,
percent_signal_waits =
CONVERT
(
Expand Down Expand Up @@ -902,7 +902,12 @@ OPTION(MAXDOP 1, RECOMPILE);',
CONVERT
(
decimal(38, 2),
vfs.io_stall_read_ms / (1.0 * vfs.num_of_reads)
ISNULL
(
vfs.io_stall_read_ms /
(1.0 * NULLIF(vfs.num_of_reads, 0)),
0
)
),
total_gb_written =
CASE
Expand All @@ -920,7 +925,12 @@ OPTION(MAXDOP 1, RECOMPILE);',
CONVERT
(
decimal(38, 2),
vfs.io_stall_write_ms / (1.0 * vfs.num_of_writes)
ISNULL
(
vfs.io_stall_write_ms /
(1.0 * NULLIF(vfs.num_of_writes, 0)),
0
)
),
sample_time =
GETDATE()
Expand All @@ -939,8 +949,11 @@ OPTION(MAXDOP 1, RECOMPILE);',
AND vfs.database_id = f.database_id'
END +
N'
WHERE vfs.num_of_reads > 0
AND vfs.num_of_writes > 0;'
WHERE
(
vfs.num_of_reads > 0
OR vfs.num_of_writes > 0
);'
);

IF @debug = 1
Expand Down

0 comments on commit f3a9ce4

Please sign in to comment.