Skip to content

Commit

Permalink
Update sp_PressureDetector.sql
Browse files Browse the repository at this point in the history
Tiny tweaks
  • Loading branch information
erikdarlingdata committed Jun 28, 2024
1 parent a0dcd41 commit 95ac801
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion sp_PressureDetector/sp_PressureDetector.sql
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,8 @@ OPTION(MAXDOP 1, RECOMPILE);',
(
dows.wait_type = N'SLEEP_TASK'
AND ISNULL(CONVERT(decimal(38, 2), dows.wait_time_ms /
NULLIF(1.* dows.waiting_tasks_count, 0.)), 0.) > 1000.
NULLIF(1.* dows.waiting_tasks_count, 0.)), 0.) >=
CASE WHEN @sample_seconds > 0 THEN 0. ELSE 1000. END
)
)
AND
Expand Down Expand Up @@ -1989,6 +1990,19 @@ OPTION(MAXDOP 1, RECOMPILE);',
THEN N''ObjPerm''
ELSE domcc.name
END
HAVING
SUM
(' +
CASE
@pages_kb
WHEN 1
THEN N'
domcc.pages_in_use_kb'
ELSE N'
domcc.single_pages_in_use_kb +
domcc.multi_pages_in_use_kb'
END + N'
) / 1024. / 1024. > 0.5
ORDER BY
pages_gb DESC
FOR XML
Expand All @@ -2008,6 +2022,19 @@ OPTION(MAXDOP 1, RECOMPILE);',
N'@cache_xml xml OUTPUT',
@cache_xml OUTPUT;

IF @cache_xml IS NULL
BEGIN
SELECT
@cache_xml =
(
SELECT
N'No significant caches detected'
FOR XML
PATH(N'cache'),
TYPE
);
END;

SELECT
low_memory =
@low_memory,
Expand Down

0 comments on commit 95ac801

Please sign in to comment.