Skip to content

Commit

Permalink
Merge pull request #384 from erikdarlingdata/dev
Browse files Browse the repository at this point in the history
Update sp_HealthParser.sql
  • Loading branch information
erikdarlingdata authored Mar 26, 2024
2 parents 6e46af4 + ef27dbd commit 7ebbcb6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions sp_HealthParser/sp_HealthParser.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ALTER PROCEDURE
@end_date datetimeoffset(7) = NULL, /*End date for events*/
@warnings_only bit = 0, /*Only show results from recorded warnings*/
@database_name sysname = NULL, /*Filter to a specific database for blocking)*/
@wait_duration_ms bigint = 0, /*Minimum duration to show query waits*/
@wait_duration_ms bigint = 500, /*Minimum duration to show query waits*/
@wait_round_interval_minutes bigint = 60, /*Nearest interval to round wait stats to*/
@skip_locks bit = 0, /*Skip the blocking and deadlocks*/
@pending_task_threshold integer = 10, /*Minimum number of pending tasks to care about*/
Expand Down Expand Up @@ -1165,8 +1165,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
RTRIM(CONVERT(date, @start_date)) +
' and ' +
RTRIM(CONVERT(date, @end_date)) +
' with a minimum duration of ' +
RTRIM(@wait_duration_ms) +
'.'
ELSE 'no significant waits found!'
END;
Expand Down Expand Up @@ -1262,7 +1260,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
CROSS APPLY w.x.nodes('/event/data/value/queryProcessing/topWaits/nonPreemptive/byDuration/wait') AS w2(x2)
WHERE w.x.exist('(data[@name="component"]/text[.= "QUERY_PROCESSING"])') = 1
AND (w.x.exist('(data[@name="state"]/text[.= "WARNING"])') = @warnings_only OR @warnings_only = 0)
AND w2.x2.exist('@averageWaitTime[.>=1000]') = 1
AND w2.x2.exist('@averageWaitTime[.>= sql:variable("@wait_duration_ms")]') = 1
AND NOT EXISTS
(
SELECT
Expand Down Expand Up @@ -1339,7 +1337,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
RTRIM(CONVERT(date, @start_date)) +
' and ' +
RTRIM(CONVERT(date, @end_date)) +
' with a minimum duration of ' +
' with a minimum average duration of ' +
RTRIM(@wait_duration_ms) +
'.'
ELSE 'no significant waits found!'
Expand Down

0 comments on commit 7ebbcb6

Please sign in to comment.