{"id":4421,"date":"2014-11-12T12:19:32","date_gmt":"2014-11-12T20:19:32","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/paul\/?p=4421"},"modified":"2018-09-25T04:54:27","modified_gmt":"2018-09-25T11:54:27","slug":"capturing-wait-statistics-period-time","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/","title":{"rendered":"Capturing wait statistics for a period of time"},"content":{"rendered":"<p>[Edit 2016: Check out my new resource &#8211; a comprehensive library of all wait types and latch classes &#8211; see <a href=\"https:\/\/www.SQLskills.com\/help\/waits\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.]<\/p>\n<p>(Script last updated June 13, 2018)<\/p>\n<p>In both my wait statistics pre-conference workshops at the PASS Summit and SQLintersection I promised to do a bunch of blog posts. The first one on the list is a simple script to allow you to capture all the waits that occurred over a period of time.<\/p>\n<p>The script does the following:<\/p>\n<ul>\n<li>Creates two temporary tables<\/li>\n<li>Captures the output from sys.dm_os_wait_stats into the first table<\/li>\n<li>Waits for a configurable delay (line 41 in the script &#8211; I made it 30 minutes in the example)<\/li>\n<li>Captures the output from sys.dm_os_wait_stats into the second\u00a0table<\/li>\n<li>Provides my usual wait stats output on the results<\/li>\n<\/ul>\n<p>Enjoy!<\/p>\n<pre class=\"brush: sql; title: ; toolbar: true; wrap-lines: true; notranslate\" title=\"\">\r\n\/*============================================================================\r\n  File:     ShortPeriodWaitStats.sql\r\n \r\n  Summary:  Short snapshot of wait stats\r\n \r\n  SQL Server Versions: 2005 onwards\r\n------------------------------------------------------------------------------\r\n  Written by Paul S. Randal, SQLskills.com\r\n \r\n  (c) 2018, SQLskills.com. All rights reserved.\r\n\r\n  Last update 9\/25\/2018\r\n \r\n  For more scripts and sample code, check out http:\/\/www.SQLskills.com\r\n \r\n  You may alter this code for your own *non-commercial* purposes (e.g. in a\r\n  for-sale commercial tool). Use in your own environment is encouraged.\r\n  You may republish altered code as long as you include this copyright and\r\n  give due credit, but you must obtain prior permission before blogging\r\n  this code.\r\n \r\n  THIS CODE AND INFORMATION ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF\r\n  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED\r\n  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\/OR FITNESS FOR A\r\n  PARTICULAR PURPOSE.\r\n============================================================================*\/\r\n \r\nIF EXISTS (SELECT * FROM &#x5B;tempdb].&#x5B;sys].&#x5B;objects]\r\n    WHERE &#x5B;name] = N'##SQLskillsStats1')\r\n    DROP TABLE &#x5B;##SQLskillsStats1];\r\n \r\nIF EXISTS (SELECT * FROM &#x5B;tempdb].&#x5B;sys].&#x5B;objects]\r\n    WHERE &#x5B;name] = N'##SQLskillsStats2')\r\n    DROP TABLE &#x5B;##SQLskillsStats2];\r\nGO\r\n \r\nSELECT &#x5B;wait_type], &#x5B;waiting_tasks_count], &#x5B;wait_time_ms],\r\n       &#x5B;max_wait_time_ms], &#x5B;signal_wait_time_ms]\r\nINTO ##SQLskillsStats1\r\nFROM sys.dm_os_wait_stats;\r\nGO\r\n \r\nWAITFOR DELAY '00:30:00';\r\nGO\r\n \r\nSELECT &#x5B;wait_type], &#x5B;waiting_tasks_count], &#x5B;wait_time_ms],\r\n       &#x5B;max_wait_time_ms], &#x5B;signal_wait_time_ms]\r\nINTO ##SQLskillsStats2\r\nFROM sys.dm_os_wait_stats;\r\nGO\r\n \r\nWITH &#x5B;DiffWaits] AS\r\n(SELECT\r\n-- Waits that weren't in the first snapshot\r\n        &#x5B;ts2].&#x5B;wait_type],\r\n        &#x5B;ts2].&#x5B;wait_time_ms],\r\n        &#x5B;ts2].&#x5B;signal_wait_time_ms],\r\n        &#x5B;ts2].&#x5B;waiting_tasks_count]\r\n    FROM &#x5B;##SQLskillsStats2] AS &#x5B;ts2]\r\n    LEFT OUTER JOIN &#x5B;##SQLskillsStats1] AS &#x5B;ts1]\r\n        ON &#x5B;ts2].&#x5B;wait_type] = &#x5B;ts1].&#x5B;wait_type]\r\n    WHERE &#x5B;ts1].&#x5B;wait_type] IS NULL\r\n    AND &#x5B;ts2].&#x5B;wait_time_ms] &gt; 0\r\nUNION\r\nSELECT\r\n-- Diff of waits in both snapshots\r\n        &#x5B;ts2].&#x5B;wait_type],\r\n        &#x5B;ts2].&#x5B;wait_time_ms] - &#x5B;ts1].&#x5B;wait_time_ms] AS &#x5B;wait_time_ms],\r\n        &#x5B;ts2].&#x5B;signal_wait_time_ms] - &#x5B;ts1].&#x5B;signal_wait_time_ms] AS &#x5B;signal_wait_time_ms],\r\n        &#x5B;ts2].&#x5B;waiting_tasks_count] - &#x5B;ts1].&#x5B;waiting_tasks_count] AS &#x5B;waiting_tasks_count]\r\n    FROM &#x5B;##SQLskillsStats2] AS &#x5B;ts2]\r\n    LEFT OUTER JOIN &#x5B;##SQLskillsStats1] AS &#x5B;ts1]\r\n        ON &#x5B;ts2].&#x5B;wait_type] = &#x5B;ts1].&#x5B;wait_type]\r\n    WHERE &#x5B;ts1].&#x5B;wait_type] IS NOT NULL\r\n    AND &#x5B;ts2].&#x5B;waiting_tasks_count] - &#x5B;ts1].&#x5B;waiting_tasks_count] &gt; 0\r\n    AND &#x5B;ts2].&#x5B;wait_time_ms] - &#x5B;ts1].&#x5B;wait_time_ms] &gt; 0),\r\n&#x5B;Waits] AS\r\n    (SELECT\r\n        &#x5B;wait_type],\r\n        &#x5B;wait_time_ms] \/ 1000.0 AS &#x5B;WaitS],\r\n        (&#x5B;wait_time_ms] - &#x5B;signal_wait_time_ms]) \/ 1000.0 AS &#x5B;ResourceS],\r\n        &#x5B;signal_wait_time_ms] \/ 1000.0 AS &#x5B;SignalS],\r\n        &#x5B;waiting_tasks_count] AS &#x5B;WaitCount],\r\n        100.0 * &#x5B;wait_time_ms] \/ SUM (&#x5B;wait_time_ms]) OVER() AS &#x5B;Percentage],\r\n        ROW_NUMBER() OVER(ORDER BY &#x5B;wait_time_ms] DESC) AS &#x5B;RowNum]\r\n    FROM &#x5B;DiffWaits]\r\n    WHERE &#x5B;wait_type] NOT IN (\r\n        -- These wait types are almost 100% never a problem and so they are\r\n        -- filtered out to avoid them skewing the results. Click on the URL\r\n        -- for more information.\r\n        N'BROKER_EVENTHANDLER', -- https:\/\/www.sqlskills.com\/help\/waits\/BROKER_EVENTHANDLER\r\n        N'BROKER_RECEIVE_WAITFOR', -- https:\/\/www.sqlskills.com\/help\/waits\/BROKER_RECEIVE_WAITFOR\r\n        N'BROKER_TASK_STOP', -- https:\/\/www.sqlskills.com\/help\/waits\/BROKER_TASK_STOP\r\n        N'BROKER_TO_FLUSH', -- https:\/\/www.sqlskills.com\/help\/waits\/BROKER_TO_FLUSH\r\n        N'BROKER_TRANSMITTER', -- https:\/\/www.sqlskills.com\/help\/waits\/BROKER_TRANSMITTER\r\n        N'CHECKPOINT_QUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/CHECKPOINT_QUEUE\r\n        N'CHKPT', -- https:\/\/www.sqlskills.com\/help\/waits\/CHKPT\r\n        N'CLR_AUTO_EVENT', -- https:\/\/www.sqlskills.com\/help\/waits\/CLR_AUTO_EVENT\r\n        N'CLR_MANUAL_EVENT', -- https:\/\/www.sqlskills.com\/help\/waits\/CLR_MANUAL_EVENT\r\n        N'CLR_SEMAPHORE', -- https:\/\/www.sqlskills.com\/help\/waits\/CLR_SEMAPHORE\r\n        N'CXCONSUMER', -- https:\/\/www.sqlskills.com\/help\/waits\/CXCONSUMER\r\n\r\n        -- Maybe comment these four out if you have mirroring issues\r\n        N'DBMIRROR_DBM_EVENT', -- https:\/\/www.sqlskills.com\/help\/waits\/DBMIRROR_DBM_EVENT\r\n        N'DBMIRROR_EVENTS_QUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/DBMIRROR_EVENTS_QUEUE\r\n        N'DBMIRROR_WORKER_QUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/DBMIRROR_WORKER_QUEUE\r\n        N'DBMIRRORING_CMD', -- https:\/\/www.sqlskills.com\/help\/waits\/DBMIRRORING_CMD\r\n\r\n        N'DIRTY_PAGE_POLL', -- https:\/\/www.sqlskills.com\/help\/waits\/DIRTY_PAGE_POLL\r\n        N'DISPATCHER_QUEUE_SEMAPHORE', -- https:\/\/www.sqlskills.com\/help\/waits\/DISPATCHER_QUEUE_SEMAPHORE\r\n        N'EXECSYNC', -- https:\/\/www.sqlskills.com\/help\/waits\/EXECSYNC\r\n        N'FSAGENT', -- https:\/\/www.sqlskills.com\/help\/waits\/FSAGENT\r\n        N'FT_IFTS_SCHEDULER_IDLE_WAIT', -- https:\/\/www.sqlskills.com\/help\/waits\/FT_IFTS_SCHEDULER_IDLE_WAIT\r\n        N'FT_IFTSHC_MUTEX', -- https:\/\/www.sqlskills.com\/help\/waits\/FT_IFTSHC_MUTEX\r\n\r\n        -- Maybe comment these six out if you have AG issues\r\n        N'HADR_CLUSAPI_CALL', -- https:\/\/www.sqlskills.com\/help\/waits\/HADR_CLUSAPI_CALL\r\n        N'HADR_FILESTREAM_IOMGR_IOCOMPLETION', -- https:\/\/www.sqlskills.com\/help\/waits\/HADR_FILESTREAM_IOMGR_IOCOMPLETION\r\n        N'HADR_LOGCAPTURE_WAIT', -- https:\/\/www.sqlskills.com\/help\/waits\/HADR_LOGCAPTURE_WAIT\r\n        N'HADR_NOTIFICATION_DEQUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/HADR_NOTIFICATION_DEQUEUE\r\n        N'HADR_TIMER_TASK', -- https:\/\/www.sqlskills.com\/help\/waits\/HADR_TIMER_TASK\r\n        N'HADR_WORK_QUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/HADR_WORK_QUEUE\r\n\r\n        N'KSOURCE_WAKEUP', -- https:\/\/www.sqlskills.com\/help\/waits\/KSOURCE_WAKEUP\r\n        N'LAZYWRITER_SLEEP', -- https:\/\/www.sqlskills.com\/help\/waits\/LAZYWRITER_SLEEP\r\n        N'LOGMGR_QUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/LOGMGR_QUEUE\r\n        N'MEMORY_ALLOCATION_EXT', -- https:\/\/www.sqlskills.com\/help\/waits\/MEMORY_ALLOCATION_EXT\r\n        N'ONDEMAND_TASK_QUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/ONDEMAND_TASK_QUEUE\r\n        N'PARALLEL_REDO_DRAIN_WORKER', -- https:\/\/www.sqlskills.com\/help\/waits\/PARALLEL_REDO_DRAIN_WORKER\r\n        N'PARALLEL_REDO_LOG_CACHE', -- https:\/\/www.sqlskills.com\/help\/waits\/PARALLEL_REDO_LOG_CACHE\r\n        N'PARALLEL_REDO_TRAN_LIST', -- https:\/\/www.sqlskills.com\/help\/waits\/PARALLEL_REDO_TRAN_LIST\r\n        N'PARALLEL_REDO_WORKER_SYNC', -- https:\/\/www.sqlskills.com\/help\/waits\/PARALLEL_REDO_WORKER_SYNC\r\n        N'PARALLEL_REDO_WORKER_WAIT_WORK', -- https:\/\/www.sqlskills.com\/help\/waits\/PARALLEL_REDO_WORKER_WAIT_WORK\r\n        N'PREEMPTIVE_XE_GETTARGETSTATE', -- https:\/\/www.sqlskills.com\/help\/waits\/PREEMPTIVE_XE_GETTARGETSTATE\r\n        N'PWAIT_ALL_COMPONENTS_INITIALIZED', -- https:\/\/www.sqlskills.com\/help\/waits\/PWAIT_ALL_COMPONENTS_INITIALIZED\r\n        N'PWAIT_DIRECTLOGCONSUMER_GETNEXT', -- https:\/\/www.sqlskills.com\/help\/waits\/PWAIT_DIRECTLOGCONSUMER_GETNEXT\r\n        N'QDS_PERSIST_TASK_MAIN_LOOP_SLEEP', -- https:\/\/www.sqlskills.com\/help\/waits\/QDS_PERSIST_TASK_MAIN_LOOP_SLEEP\r\n        N'QDS_ASYNC_QUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/QDS_ASYNC_QUEUE\r\n        N'QDS_CLEANUP_STALE_QUERIES_TASK_MAIN_LOOP_SLEEP',\r\n            -- https:\/\/www.sqlskills.com\/help\/waits\/QDS_CLEANUP_STALE_QUERIES_TASK_MAIN_LOOP_SLEEP\r\n        N'QDS_SHUTDOWN_QUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/QDS_SHUTDOWN_QUEUE\r\n        N'REDO_THREAD_PENDING_WORK', -- https:\/\/www.sqlskills.com\/help\/waits\/REDO_THREAD_PENDING_WORK\r\n        N'REQUEST_FOR_DEADLOCK_SEARCH', -- https:\/\/www.sqlskills.com\/help\/waits\/REQUEST_FOR_DEADLOCK_SEARCH\r\n        N'RESOURCE_QUEUE', -- https:\/\/www.sqlskills.com\/help\/waits\/RESOURCE_QUEUE\r\n        N'SERVER_IDLE_CHECK', -- https:\/\/www.sqlskills.com\/help\/waits\/SERVER_IDLE_CHECK\r\n        N'SLEEP_BPOOL_FLUSH', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_BPOOL_FLUSH\r\n        N'SLEEP_DBSTARTUP', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_DBSTARTUP\r\n        N'SLEEP_DCOMSTARTUP', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_DCOMSTARTUP\r\n        N'SLEEP_MASTERDBREADY', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_MASTERDBREADY\r\n        N'SLEEP_MASTERMDREADY', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_MASTERMDREADY\r\n        N'SLEEP_MASTERUPGRADED', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_MASTERUPGRADED\r\n        N'SLEEP_MSDBSTARTUP', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_MSDBSTARTUP\r\n        N'SLEEP_SYSTEMTASK', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_SYSTEMTASK\r\n        N'SLEEP_TASK', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_TASK\r\n        N'SLEEP_TEMPDBSTARTUP', -- https:\/\/www.sqlskills.com\/help\/waits\/SLEEP_TEMPDBSTARTUP\r\n        N'SNI_HTTP_ACCEPT', -- https:\/\/www.sqlskills.com\/help\/waits\/SNI_HTTP_ACCEPT\r\n        N'SOS_WORK_DISPATCHER', -- https:\/\/www.sqlskills.com\/help\/waits\/SOS_WORK_DISPATCHER\r\n        N'SP_SERVER_DIAGNOSTICS_SLEEP', -- https:\/\/www.sqlskills.com\/help\/waits\/SP_SERVER_DIAGNOSTICS_SLEEP\r\n        N'SQLTRACE_BUFFER_FLUSH', -- https:\/\/www.sqlskills.com\/help\/waits\/SQLTRACE_BUFFER_FLUSH\r\n        N'SQLTRACE_INCREMENTAL_FLUSH_SLEEP', -- https:\/\/www.sqlskills.com\/help\/waits\/SQLTRACE_INCREMENTAL_FLUSH_SLEEP\r\n        N'SQLTRACE_WAIT_ENTRIES', -- https:\/\/www.sqlskills.com\/help\/waits\/SQLTRACE_WAIT_ENTRIES\r\n        N'WAIT_FOR_RESULTS', -- https:\/\/www.sqlskills.com\/help\/waits\/WAIT_FOR_RESULTS\r\n        N'WAITFOR', -- https:\/\/www.sqlskills.com\/help\/waits\/WAITFOR\r\n        N'WAITFOR_TASKSHUTDOWN', -- https:\/\/www.sqlskills.com\/help\/waits\/WAITFOR_TASKSHUTDOWN\r\n        N'WAIT_XTP_RECOVERY', -- https:\/\/www.sqlskills.com\/help\/waits\/WAIT_XTP_RECOVERY\r\n        N'WAIT_XTP_HOST_WAIT', -- https:\/\/www.sqlskills.com\/help\/waits\/WAIT_XTP_HOST_WAIT\r\n        N'WAIT_XTP_OFFLINE_CKPT_NEW_LOG', -- https:\/\/www.sqlskills.com\/help\/waits\/WAIT_XTP_OFFLINE_CKPT_NEW_LOG\r\n        N'WAIT_XTP_CKPT_CLOSE', -- https:\/\/www.sqlskills.com\/help\/waits\/WAIT_XTP_CKPT_CLOSE\r\n        N'XE_DISPATCHER_JOIN', -- https:\/\/www.sqlskills.com\/help\/waits\/XE_DISPATCHER_JOIN\r\n        N'XE_DISPATCHER_WAIT', -- https:\/\/www.sqlskills.com\/help\/waits\/XE_DISPATCHER_WAIT\r\n        N'XE_TIMER_EVENT' -- https:\/\/www.sqlskills.com\/help\/waits\/XE_TIMER_EVENT\r\n\t)\r\n    )\r\nSELECT\r\n    &#x5B;W1].&#x5B;wait_type] AS &#x5B;WaitType],\r\n    CAST (&#x5B;W1].&#x5B;WaitS] AS DECIMAL (16, 2)) AS &#x5B;Wait_S],\r\n    CAST (&#x5B;W1].&#x5B;ResourceS] AS DECIMAL (16, 2)) AS &#x5B;Resource_S],\r\n    CAST (&#x5B;W1].&#x5B;SignalS] AS DECIMAL (16, 2)) AS &#x5B;Signal_S],\r\n    &#x5B;W1].&#x5B;WaitCount] AS &#x5B;WaitCount],\r\n    CAST (&#x5B;W1].&#x5B;Percentage] AS DECIMAL (5, 2)) AS &#x5B;Percentage],\r\n    CAST ((&#x5B;W1].&#x5B;WaitS] \/ &#x5B;W1].&#x5B;WaitCount]) AS DECIMAL (16, 4)) AS &#x5B;AvgWait_S],\r\n    CAST ((&#x5B;W1].&#x5B;ResourceS] \/ &#x5B;W1].&#x5B;WaitCount]) AS DECIMAL (16, 4)) AS &#x5B;AvgRes_S],\r\n    CAST ((&#x5B;W1].&#x5B;SignalS] \/ &#x5B;W1].&#x5B;WaitCount]) AS DECIMAL (16, 4)) AS &#x5B;AvgSig_S],\r\n    CAST ('https:\/\/www.sqlskills.com\/help\/waits\/' + MAX (&#x5B;W1].&#x5B;wait_type]) as XML) AS &#x5B;Help\/Info URL]\r\nFROM &#x5B;Waits] AS &#x5B;W1]\r\nINNER JOIN &#x5B;Waits] AS &#x5B;W2]\r\n    ON &#x5B;W2].&#x5B;RowNum] &lt;= &#x5B;W1].&#x5B;RowNum]\r\nGROUP BY &#x5B;W1].&#x5B;RowNum], &#x5B;W1].&#x5B;wait_type], &#x5B;W1].&#x5B;WaitS],\r\n    &#x5B;W1].&#x5B;ResourceS], &#x5B;W1].&#x5B;SignalS], &#x5B;W1].&#x5B;WaitCount], &#x5B;W1].&#x5B;Percentage]\r\nHAVING SUM (&#x5B;W2].&#x5B;Percentage]) - &#x5B;W1].&#x5B;Percentage] &lt; 95; -- percentage threshold\r\nGO\r\n \r\n-- Cleanup\r\nIF EXISTS (SELECT * FROM &#x5B;tempdb].&#x5B;sys].&#x5B;objects]\r\n    WHERE &#x5B;name] = N'##SQLskillsStats1')\r\n    DROP TABLE &#x5B;##SQLskillsStats1];\r\n \r\nIF EXISTS (SELECT * FROM &#x5B;tempdb].&#x5B;sys].&#x5B;objects]\r\n    WHERE &#x5B;name] = N'##SQLskillsStats2')\r\n    DROP TABLE &#x5B;##SQLskillsStats2];\r\nGO\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>[Edit 2016: Check out my new resource &#8211; a comprehensive library of all wait types and latch classes &#8211; see here.] (Script last updated June 13, 2018) In both my wait statistics pre-conference workshops at the PASS Summit and SQLintersection I promised to do a bunch of blog posts. The first one on the list [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,66,101],"tags":[],"class_list":["post-4421","post","type-post","status-publish","format-standard","hentry","category-example-scripts","category-performance-tuning","category-wait-stats"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Capturing wait statistics for a period of time - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Capturing wait statistics for a period of time - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"[Edit 2016: Check out my new resource &#8211; a comprehensive library of all wait types and latch classes &#8211; see here.] (Script last updated June 13, 2018) In both my wait statistics pre-conference workshops at the PASS Summit and SQLintersection I promised to do a bunch of blog posts. The first one on the list [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2014-11-12T20:19:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-09-25T11:54:27+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/\",\"name\":\"Capturing wait statistics for a period of time - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2014-11-12T20:19:32+00:00\",\"dateModified\":\"2018-09-25T11:54:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Capturing wait statistics for a period of time\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Capturing wait statistics for a period of time - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/","og_locale":"en_US","og_type":"article","og_title":"Capturing wait statistics for a period of time - Paul S. Randal","og_description":"[Edit 2016: Check out my new resource &#8211; a comprehensive library of all wait types and latch classes &#8211; see here.] (Script last updated June 13, 2018) In both my wait statistics pre-conference workshops at the PASS Summit and SQLintersection I promised to do a bunch of blog posts. The first one on the list [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/","og_site_name":"Paul S. Randal","article_published_time":"2014-11-12T20:19:32+00:00","article_modified_time":"2018-09-25T11:54:27+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/","name":"Capturing wait statistics for a period of time - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2014-11-12T20:19:32+00:00","dateModified":"2018-09-25T11:54:27+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/capturing-wait-statistics-period-time\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Capturing wait statistics for a period of time"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/4421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=4421"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/4421\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=4421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=4421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=4421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}