fix(inputs.sqlserver): set lower deadlock priority (#11522)

This commit is contained in:
Varlet Nicolas 2022-07-19 18:12:09 +02:00 committed by GitHub
parent cb0df019ec
commit ae695e8736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -1242,7 +1242,9 @@ ELSE
` `
const sqlServerRequestsV2 string = ` const sqlServerRequestsV2 string = `
SET DEADLOCK_PRIORITY -10;
SET NOCOUNT ON; SET NOCOUNT ON;
DECLARE DECLARE
@SqlStatement AS nvarchar(max) @SqlStatement AS nvarchar(max)
,@EngineEdition AS tinyint = CAST(SERVERPROPERTY('EngineEdition') AS int) ,@EngineEdition AS tinyint = CAST(SERVERPROPERTY('EngineEdition') AS int)
@ -1324,6 +1326,8 @@ EXEC sp_executesql @SqlStatement
` `
const sqlServerVolumeSpaceV2 string = ` const sqlServerVolumeSpaceV2 string = `
SET DEADLOCK_PRIORITY -10;
/* Only for on-prem version of SQL Server /* Only for on-prem version of SQL Server
Gets data about disk space, only for volumes used by SQL Server (data available form sql 2008R2 and later) Gets data about disk space, only for volumes used by SQL Server (data available form sql 2008R2 and later)
*/ */
@ -1349,6 +1353,8 @@ IF @EngineEdition IN (2,3,4) AND @MajorMinorVersion >= 1050
` `
const sqlServerCPUV2 string = ` const sqlServerCPUV2 string = `
SET DEADLOCK_PRIORITY -10;
/*The ring buffer has a new value every minute*/ /*The ring buffer has a new value every minute*/
IF SERVERPROPERTY('EngineEdition') IN (2,3,4) /*Standard,Enterpris,Express*/ IF SERVERPROPERTY('EngineEdition') IN (2,3,4) /*Standard,Enterpris,Express*/
BEGIN BEGIN