Monday, October 16, 2006

VSTT: Custom counter sets

When you are building a load test in VSTT, you can specify sets of counters to be collected as a group. VSTS provides a bunch of default counter sets, like ADO.NET, and IIS, and SQL.  Those counter sets are great for default programs and installations.

If your service or application, like mine, creates and publishes custom counters, you may find a need to create your own counter sets. Once you've done so, you will almost certainly want to share those counter sets among your colleagues.

If you look in Program Files\Microsoft Visual Studio 8\Common7\IDE\Templates\LoadTest\CounterSets, you will see several .CounterSet files.  They are XML files (with a really easy schema), which define what counters and instances should be collected.

If you edit a custom counter set through the UI, you should find a new file in that directory. 

If you don't want to deal with the UI (it can be slow), then you can create the xml file directly.  This will enable you to build the custom counter sets as part of your build process, or part of the development process.  Manipulating the XML is shockingly easy, due to the simple schema.

You can then check that file into your source control (you are using source control, right?), and all your buddies can copy it to the correct directory on their computer.

The next time they start VSTT, they will see the counter set in the UI, in the list of available counter sets, and can map those counters to computers that you will be monitoring in your load test.

No comments: