Skip to content

sp_PressureDetector - disk metrics - avg_read/write_stall_ms and total_avg_stall_ms decimals aren't decimalling #565

@VladDBA

Description

@VladDBA

Hi Erik,

I tried out sp_PressureDetector (really nifty stored procedure, btw!) and noticed a small bug.

Version of the script
sp_PressureDetector

What is the current behavior?
In the disk metrics section the decimals for avg_read_stall_ms and write_stall_ms are always 00 because you're dividing BIGINT (vfs.io_stall_write/read_ms) to BIGINT ((NULLIF(vfs.num_of_writes/reads, 0)) before the conversion to DECIMAL(38,2).
This also ends up affecting total_avg_stall_ms.

Image

If the current behavior is a bug, please provide the steps to reproduce.
EXEC sp_PressureDetector;

What is the expected behavior?

Image

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
Not OS or SQL Server version dependent.

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

PR incoming with the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions