erikdarlingdata / DarlingData

Open source SQL Server nonsense: sp_PressureDetector, sp_QuickieStore, sp_HumanEvents, etc.
https://www.erikdarling.com/
MIT License
443 stars 132 forks source link

sp_HumanEventsBlockViewer limited to Blocked Process Threshold = 5 #423

Closed JiriDolezalSQL closed 1 month ago

JiriDolezalSQL commented 1 month ago

Which script is your question about?

sp_HumanEventsBlockViewer.sql

Script version

SELECT @version = '3.5', @version_date = '20240401';

Is your question about how they work, or the results?

The question is mostly about Why it works like this...see below

Questions about how the scripts work can be answered here.

Okay, what's your question?

Why is sp_HumanEventsBlockViewer limited to Blocked Process Threshold being set to exactly 5 and not >= 5?

Enter your query and press F5.

EXEC sys.sp_configure 'show advanced options', 1; EXEC sys.sp_configure 'blocked process threshold', 10; / other than 5 / RECONFIGURE;

EXEC sp_HumanEventsBlockViewer @session_name = N'blocked_process_report' / name of the session /

Error message: Msg 50000, Level 11, State 0, Procedure sp_HumanEventsBlockViewer, Line 195 [Batch Start Line 0] For best results, set up the blocked process report like this: EXEC sys.sp_configure 'show advanced options', 1; EXEC sys.sp_configure 'blocked process threshold', 5; / Seconds of blocking before a report is generated / RECONFIGURE;

IMPORTANT: If you're going to contribute code, please read the contributing guide first. https://github.com/erikdarlingdata/DarlingData/blob/main/CONTRIBUTING.md

erikdarlingdata commented 1 month ago

@JiriDolezalSQL that's just a silly-billy copy and paste error in the RAISERROR. It should have been level 10 to print a non-stopping message.

JiriDolezalSQL commented 1 month ago

Great. Many thanks.

Just wondering...Shouldn't that be 0 instead of 10 as the docs stated: For compatibility reasons, the Database Engine converts severity 10 to severity 0 before returning the error information to the calling application.

erikdarlingdata commented 1 month ago

@JiriDolezalSQL Can I be honest with you? I just don't care about that. It makes no difference either way.