amachanic / sp_whoisactive

sp_whoisactive
GNU General Public License v3.0
1.18k stars 290 forks source link

Output wait duration in a dedicated column #82

Open ant-222 opened 2 years ago

ant-222 commented 2 years ago

Proposal

The current version of sp_whoisactive reports wait duration as part of the text value in the wait_info column, which is human-oriented and unamenable to sorting, filtering, or any other automated, machine-based analysis. This is a request for a dedicated numeric column to store this important metric—wait_duration or wait_duration_ms (for milliseconds)—that shall be usable in MSSQL predicates and operators and shall facilitate quantitative lock analysis and automated gathering of wait statistics.

Whereas the numeric value of lock duration is already used internally inside sp_whoisactive, this request should not be hard to implement.

Sample use

  1. Monitor waits longer than 30 seconds.
  2. Sort collected wait information by duraition.
imajaydwivedi commented 1 year ago

+1 for this enhancement. Is anyone working on this? If not, I can take this one.