i am using this script to get the cpu utilization. Unfortanetly I get wrong results. The NonSQLCPUUtilization is always negative. It's a SQL Server 2014 with CU4. We have an other SQL Server 2014 with CU4 where it works correctly. Any hints are appreciated.
select top 10
id, SQLServerCPUUtilization, 100 - SystemIdle - SQLServerCPUUtilization as NonSQLCPUUtilization
record.value('(./Record/@id)', 'int') as id,
record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)', 'int') as SystemIdle,
record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)', 'int') as SQLServerCPUUtilization,
select timestamp, convert(xml, record) as record
where ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR'
and record like '%<SystemHealth>%') as RingBufferInfo
) AS TabularInfo
order by id desc