Importing and Exporting Perfmon Counters

I am posting this utility to help people who need to import or export perfmon counters within a Visual Studio Load Test Results database. The zip file in this post contains a stand-alone executable and the necessary SQL code for performing the imports and exports. I have also included the core C# source code for the classes that do the actual work so you can see how the import and export happen.

Please see the included RTF help file (portions reproduced below) for setup and usage instructions. Please provide any feedback through the codeplex project site.

Perfmon Import Export tool

This tool provides a quick interface for importing and exporting Performance Monitor counters from/to a Visual Studio Load test Results database. The bulk of the work is done inside the SQL database itself and this program simply facilitates the work of choosing the necessary items and locations for the work. The code is taken from a reporting tool project I am working on (not yet publicly released) and therefore requires a few manual steps before it gets used the first time. It also does not have a ton of error checking.


In order to prep the database:

  • Open SQL Server Management Studio (or any other tool that allows you to execute multiple SQL commands from a single file) and load the TSL_Code_For_SqlDb.sql file.
  • Execute the script against the LoadTest2010 database. This will create the following items:
    • TABLE TSL_StagingTableForPerfmonImports
    • VIEW MTSL_View_PerfmonInstanceNamesAndIds
    • PROCEDURE TSL_prc_GetStartingValuesForImportingPerfmon
    • PROCEDURE TSL_prc_UpdatePerfmonTablesFromImport
    • PROCEDURE TSL_prc_PerfCounterExportToCSV
  • If you get any messages that the table, view or procedure already exists, this means that you have used a beta copy of the reporting tool at some point. Manually remove or delete the item in question and re-run that part of the script. This should NOT break the reporting tool, but since there are a number of older versions of the tool floating around, you need to make sure that the version with this tool is the one being used.




Unblocking the downloaded ZIP File

Be sure to unblock the zip file after downloading it. Right click on the zip and choose “Properties” Then click on “Unblock”