Ok,this should be fairly simple, but I'm missing something. Most of this could be derived out of the DMV sys.dm_os_wait_stats. CPUTime + ResourceWaitTime + SignalWaitTime= Total Query Response Time Where do I get the total CPUTime? This is running time, so how to join historical and running data? There must be another DMV Can I get script for this? THx
The total time that SQL Server spent working since it was last restarted you can get from @@CPU_BUSY.
Thanks, but I realized I would probably want to get all this info from current info, and not historical? dm_exec_requests and dm_waiting_tasks seem like some candidates. OK, I did this - but result doesn't seem what I'm looking for: Query response time in this case is 3+ hours???--------------------------------- Select @@cpu_busy as CPUTime,signalWaitTimeMs=sum(signal_wait_time_ms) ,resourceWaitTimeMs=sum(wait_time_ms - signal_wait_time_ms), @@cpu_busy + sum(wait_time_ms - signal_wait_time_ms) + sum(signal_wait_time_ms) as TotalQueryResponseTime from sys.dm_os_wait_stats------------------------------------