One of my self-assigned tasks is to monitor the performance of our reports. It’s a good way to see how reports behave over time or what effect changes on a report has. There’s a few methods I use, from seeing what report is running right now to how that report compares to other report runs.
Reporting Services saves report execution statistics in a table called ExecutionLog in the ReportServer database on your report server. In SQL 2008 there’s also a view called ExecutionLog2 that does a few joins and shows the values in a way that may make more sense. I’m not going to go into too much detail about that view or table here, they’ve been written up pretty well in posts by others. See the references section at the end for a few helpful links.
The only problem with the ExecutionLog table is that it doesn’t show a row for a report until the report execution is complete. It doesn’t help you to see what report is running at a particular time. There are times when the report server is under load that I want to track what reports are running at that exact time. To do that I wrote a small VB.NET program that will show me what’s running anytime I choose. I wrote mine in Visual Studio 2010 but it could be created in earlier versions, and you can easily convert this to C# if you wish.
To start, create a new Windows Forms project called Current Reports, create 2 forms, set one up to enter login information, and drop a data grid with a label for each report server you want to monitor, a timer control, and a button or the other. Next create a web reference to a SQL2008 report server and call it ReportService:
Then set a reference to the report service, one for each server you’re monitoring. Pass in the login information from your login form.
Finally, write a procedure to fetch the information you want to see. I call the procedure when I first load the form, again when the timer fires (I set the timer interval to 30 seconds), or on demand when I click the refresh button.
This code just checks to server for any running jobs. For each job it finds it returns the report name, the job id, when it started, and who’s running it. It also shows the time the job info was fetched, so you can see if there are any reports that have been running for a long time. You need to duplicate this for each server you want to monitor; in monitoring two so that’s why I used two data grids.
In Part 2 I’ll describe how I check the execution logs.
Robert Bruckner has a great blog on Report Server performance. This post is a great description of the ExecutionLog2 view.