Skip to content

Commit 011fee0

Browse files
authored
Fix CurrentWorkerCount query
This was yielding all threads (whether they counted against max or not - giving a bad count). This properly gets only those that matter.
1 parent ab09949 commit 011fee0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Opserver.Core/Data/SQL/SQLInstance.Properties.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Select Cast(SERVERPROPERTY(''ProductVersion'') as nvarchar(128)) Version,
115115
Cast(SERVERPROPERTY(''ProcessID'') as int) ProcessID,
116116
(Select Count(*) From sys.dm_exec_sessions) SessionCount,
117117
(Select Count(*) From sys.dm_exec_connections) ConnectionCount,
118-
(Select Sum(current_workers_count) From sys.dm_os_schedulers) CurrentWorkerCount,
118+
(Select Sum(active_workers_count) From sys.dm_os_schedulers Where status = ''VISIBLE ONLINE'') CurrentWorkerCount,
119119
(Select Count(*) From msdb.dbo.sysjobs) JobCount,
120120
cpu_count CPUCount,
121121
hyperthread_ratio HyperthreadRatio,

0 commit comments

Comments
 (0)