SQL Server 2008 R2 Service Pack 1 provides a new set of Events in Extended Events to collect performance counter data from the Windows OS that would be really useful to monitoring SQL Server. The first place I can find that they were mentioned is on a blog post by Mark Weber, a PFE for SQL and SAP at Microsoft. However, a few weeks ago a question was asked about these counters one of the forums and the question was around how to use them. I looked at the Events and found out that they aren’t really useable in their current implementation, something that is disappointing since being able to collect the data provided by these Events would really benefit most DBA’s out there.
If you look at the Events and columns, these events collect information about the Logical Disk, Processor, Process for the SQL instance, and System at 15 second intervals and makes the data available through Extended Events.
SELECT name, description FROM sys.dm_xe_objects WHERE name like 'perfobject_%'
Returns a set of counters associated with the Process performance object. The event occurs once every 15 seconds for both the SQL Server and SQL Agent processes.
Returns a set of counters associated with the System performance object. The event occurs once every 15 seconds.
Returns a set of counters associated with the Logical Disk performance object. The event occurs once every 15 seconds for each hard or fixed disk drive.
Returns a set of counters associated with the Processor performance object. The event occurs once every 15 seconds for each processor in the system.
If we look at the columns, we’ll see that the columns actually represent the individual counters under the categories exposed by the Event names. For example, the perfobject_logicaldisk event returns the following columns:
SELECT object_name, name AS column_name, description FROM sys.dm_xe_object_columns WHERE object_name = 'perfobject_logicaldisk' AND column_type = 'data' ORDER BY object_name, name
Shows the average number of bytes transferred from the disk during read operations.
Shows the average number of bytes transferred to or from the disk during write or read operations.
Shows the average number of bytes transferred to the disk during write operations.
Shows the average number of both read and write requests that were queued for the selected disk during the sample interval.
Shows the average number of read requests that were queued for the selected disk during the sample interval.
Shows the average time, in seconds, of a read operation from the disk.
Shows the time, in seconds, of the average disk transfer.
Shows the average time, in seconds, of a write operation to the disk.
Shows the average number of write requests that were queued for the selected disk during the sample interval.
Shows the number of requests outstanding on the disk at the time that the performance data is collected.
Shows the rate at which bytes are transferred to or from the disk during write or read operations.
Shows the rate at which bytes are transferred from the disk during read operations.
Shows the rate at which read operations are performed on the disk.
Shows the rate at which read and write operations are performed on the disk.
Shows the rate at which bytes are transferred to the disk during write operations.
Shows the rate at which write operations are performed on the disk.
Shows the unallocated space, in megabytes, on the disk drive. One megabyte is equal to 1,048,576 bytes.
The logical disk drive name
Shows the percentage of time that the selected disk drive is busy servicing read or write requests.
Shows the percentage of time that the selected disk drive is busy servicing read requests.
Shows the percentage of time that the selected disk drive is busy servicing write requests.
Shows the percentage of the total usable space on the selected logical disk drive that is free.
The percentage of time during the sample interval that the disk was idle.
The rate at which I/Os to the disk were split into multiple I/Os.
This all seems good, until we actually use the Events in an Event Session and take a look at the data being returned.
CREATE EVENT SESSION [XE_PerfCounters] ON SERVER ADD EVENT sqlserver.perfobject_logicaldisk ADD TARGET package0.ring_buffer; GO
Unfortunately, the counters are returning Raw values for the Event and the necessary Base counters that are required to give these values any useful meaning have been left out of the Events data. Looking at this in my test environment, it appears the counter values pulled for the perfobject_ Events are pulled directly from Win32_PerfRawData_PerfDisk_LogicalDisk, but if you look at the CookingType requirements for the counters in Win32_PerfFormattedData_PerfDisk_LogicalDisk the raw values have to be calculated by their base values for them to have meaning:
I’ve submitted Connect Item 725167 for this and I really hope that this one gets fixed in a future Cumulative Update or Service Pack.