Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Documentation/sp_BlitzFirst_Checks_by_Priority.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Before adding a new check, make sure to add a Github issue for it first, and hav

If you want to change anything about a check - the priority, finding, URL, or ID - open a Github issue first. The relevant scripts have to be updated too.

CURRENT HIGH CHECKID: 49
If you want to add a new check, start at 50.
CURRENT HIGH CHECKID: 50
If you want to add a new check, start at 51.

| Priority | FindingsGroup | Finding | URL | CheckID |
|----------|---------------------------------|---------------------------------------|-------------------------------------------------|----------|
Expand Down Expand Up @@ -58,4 +58,5 @@ If you want to add a new check, start at 50.
| 251 | Server Info | Database Count | | 22 |
| 251 | Server Info | Database Size, Total GB | | 21 |
| 251 | Server Info | Memory Grant/Workspace info | | 40 |
| 251 | Server Info | Thread Time | https://www.brentozar.com/go/threadtime | 50 |
| 254 | Informational | Thread Time Inaccurate | | 48 |
29 changes: 29 additions & 0 deletions sp_BlitzFirst.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2021,6 +2021,7 @@ If one of them is a lead blocker, consider killing that query.'' AS HowToStopit,
FROM sys.databases
WHERE database_id > 4;


/* Server Info - Memory Grants pending - CheckID 39 */
IF (@Debug = 1)
BEGIN
Expand Down Expand Up @@ -3325,6 +3326,34 @@ If one of them is a lead blocker, consider killing that query.'' AS HowToStopit,
OR max_session_percent >= 90);
END

/* Server Info - Thread Time - CheckID 50 */
IF (@Debug = 1)
BEGIN
RAISERROR('Running CheckID 50',10,1) WITH NOWAIT;
END

;WITH max_batch AS (
SELECT MAX(SampleTime) AS SampleTime
FROM #WaitStats
)
INSERT INTO #BlitzFirstResults (CheckID, Priority, FindingsGroup, Finding, Details, DetailsInt, URL)
SELECT TOP 1 50 AS CheckID,
251 AS Priority,
'Server Info' AS FindingGroup,
'Thread Time' AS Finding,
CAST(CAST(c.[Total Thread Time (Seconds)] AS DECIMAL(18,1)) AS VARCHAR(100)) AS Details,
CAST(c.[Total Thread Time (Seconds)] AS DECIMAL(18,1)) AS DetailsInt,
'https://www.brentozar.com/go/threadtime' AS URL
FROM max_batch b
JOIN #WaitStats wd2 ON
wd2.SampleTime =b.SampleTime
JOIN #WaitStats wd1 ON
wd1.wait_type=wd2.wait_type AND
wd2.SampleTime > wd1.SampleTime
CROSS APPLY (SELECT
CAST((wd2.thread_time_ms - wd1.thread_time_ms)/1000. AS DECIMAL(18,1)) AS [Total Thread Time (Seconds)]
) AS c;

/* Server Info - Batch Requests per Sec - CheckID 19 */
IF (@Debug = 1)
BEGIN
Expand Down
Loading