Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20403

Re: Instance CPU Utilization SQL2005

$
0
0

Thanks Brian, makes sense. If anyone reading this anyone wants it as a custom metric for SQL2005 we use the same query as the performance dashboard;

 

DECLARE
   @ts_now BigInt

SELECT @ts_now = cpu_ticks / cpu_ticks / ms_ticks
FROM sys.dm_os_sys_info WITH (nolock)

SELECT TOP 1 SQLProcessUtilization
FROM(
SELECT record.value('(./Record/@id)[1]', 'int')AS record_id,
    record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int')AS SystemIdle,
    record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int')AS SQLProcessUtilization,
    timestamp
FROM(
  SELECT timestamp,
     CONVERT(Xml, record)AS record
  FROM sys.dm_os_ring_buffers
  WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR'
    AND record LIKE '%<SystemHealth>%')AS x)AS y
ORDER BY record_id DESC


Viewing all articles
Browse latest Browse all 20403

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>