Skip to content

Commit

Permalink
Fix CurrentWorkerCount query
Browse files Browse the repository at this point in the history
This was yielding all threads (whether they counted against max or not - giving a bad count). This properly gets only those that matter.
  • Loading branch information
NickCraver authored Apr 10, 2020
1 parent ab09949 commit 011fee0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Opserver.Core/Data/SQL/SQLInstance.Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Select Cast(SERVERPROPERTY(''ProductVersion'') as nvarchar(128)) Version,
Cast(SERVERPROPERTY(''ProcessID'') as int) ProcessID,
(Select Count(*) From sys.dm_exec_sessions) SessionCount,
(Select Count(*) From sys.dm_exec_connections) ConnectionCount,
(Select Sum(current_workers_count) From sys.dm_os_schedulers) CurrentWorkerCount,
(Select Sum(active_workers_count) From sys.dm_os_schedulers Where status = ''VISIBLE ONLINE'') CurrentWorkerCount,
(Select Count(*) From msdb.dbo.sysjobs) JobCount,
cpu_count CPUCount,
hyperthread_ratio HyperthreadRatio,
Expand Down

0 comments on commit 011fee0

Please sign in to comment.