Dynamic management function query to view disk I/O pressure

The sys.dm_io_virtual_file_stats dynamic management function returns I/O statistics for data and log files [MDF and LDF file], with two parameters, one for database_id and another for the file_id. This function will help you to identify I/O file level.

I was led here when doing a search because we were getting enormous amounts of disk queuing the other day during a round of testing, so I started hunting around, looking for some information on some query to get this information from SQL Server, and I found this article from Itzik Ben-Gan entitled Query DMFs to Analyze Performance Stats. His stuff is always good, if some of it blows right past my non-mathematical brain quite often (as does a bit of that article) and it pointed me to some queries that are useful, but I also wanted to be able to take a "point in time" reading that I could compare with. This information, coupled with stuff from BOL here got me going.

It returns its readings since when the SQL Servers was started. I was wanting to use it to determine hotspots in the filesystem during some very heavy processing times, so I built a little snippet of code to create a table (based on the value of a variable) so you compare some segment of time.