Sorry, you need to enable JavaScript to visit this website.

Performance Counter Dumper

Performance Counter Dumper
August 02, 2019

Typically, the Performance Counter Dumper tool dumps the dataset of Windows performance counters onto a file/console. This document further describes Windows performance monitor tool usage and how the resultant output benefits project productivity.

The tool dumps the Windows performance counter(s) data set to a file/console

Our project was required to implement a high number of performance counters in the profiles/scripts so that automated monitoring could happen at regular polling intervals. While analyzing these counters, we faced the following problems. These lowered our productivity for quite a few days due to extensive manual work:

  1. We would manually go the Windows PerfMon utility to check the categories/counters/instances as there were no search criteria so we didn’t know whether the specific category/counter existed or not.
  2. A few performance counters were moved from one category to the other because of the underlying operating system and/or application version changes— analyzing the new category was another pain point.

To get rid of the above-mentioned problems, we introduced the Performance Counter Dumper tool. This performance monitor tool needs the inputs (Category/Counter/Instance) related to performance counters and then either saves the file containing the output or display the output on console. From this output, you can easily look for any specific category/counter/instance. This saves research time by 60%.

We followed the below approach to reach the solution:

  1. Checked if any solution is given on Microsoft support but found none.
  2. Discussed this internally with the team and concluded that a utility could be made which could serve the purpose.
  3. Decided to implement the functionality via batch and PowerShell scripts.

Our research time was reduced, which resulted in saving 60% of the time previously needed. This performance monitor tool could be used for any project which deals with performance counter-related data.

Benefits

  1. Quantitative Benefits

    Time to implement one counter before applying the Windows performance monitor tool: 90 minutes

    Time to implement one counter after applying said tool: 36 minutes

    Productivity percentage improved: 60%

    Let’s take the below example of how we save the money (in $) after using the Performance Counter Dumper tool:

    Before

    1. Average time for R&D of 30 monitors: 5 days
    2. Total monitors in a year to implement: 1,400
    3. Total time invested to monitor 144 monitors: 233.33 days (B/30*A)
    4. Billing per day: $180 ($20*9 hours)
    5. Total cost: $41,999.4 (C*D)

    After

    1. Average time for R&D of 30 monitors: 2 days
    2. Total monitors in a year to implement: 1,400
    3. Total time invested to monitor 144 monitors: 93.33 days (B/30 *A)
    4. Billing per day: $180 ($20*9 hours)
    5. Total cost: $16,799.4 (C*D)

    Savings: $(41,999.4 – 16,799.4) = $25,200, i.e. we saved around 60% of the cost.

  2. Qualitative Benefits
    1. Saves the time to get the details on specific counters
    2. Ease of use
    3. Avoids any manual mistakes while searching for any counter
    4. Ability to save the data permanently
    5. Can be used on any Windows platform
    6. Tool code is easily modifiable

Running the Tool

This performance monitor tool can be used in any project which deals with Windows performance data. You just need to run the batch file (tool) with the help of the given ‘ReadMe’ file.

To run the PerfMon script, run a batch file from the ‘cmdline’ and follow these steps:

****Enter your choice*****

  1. To get all counters
  2. To get all objects
  3. To get specific object details
  4. To search for counters in the file entitled ‘AllCounterInstance.txt’
  5. To print 5 sample values for counter in a graph

To save data in a file, press "Yes" else "No"

EXAMPLE 1

Option 1

This option will generate the file named as AllCounterInstance.txt and will contain all the objects and their related counters.

E.g.: One of the entries in the file will be like the one below:

\RAS\Bytes Transmitted By Disconnected Clients

Where RAS is the object name and the remaining part is one of the counters under RAS.

EXAMPLE 2

Option 2

This option will generate the file named as Objects.txt and will contain all the objects’ names on that system.

E.g.: A few entries in the file will be like below:

RAS

WSMan Quota Statistics

BranchCache

Network QoS Policy

AppV Client Streamed Data Percentage

EXAMPLE 3

Option 3

This option will create the file which has the name as the object name which you gave as the input and will contain all the counter details under that object only.

E.g.: All the objects under category RAS:

\RAS\Bytes Transmitted By Disconnected Clients

\RAS\Bytes Received By Disconnected Clients

\RAS\Failed Authentications

\RAS\Max Clients

\RAS\Total Clients

EXAMPLE 4

Option 4

This option will search for a given counter in the file ‘AllCounterInstance.txt’. If found, it will then display the line where the counter was found and if not found, then it will show nothing and will exit after 5 seconds.

E.g.: If you search for the counter "Total Clients", then it will display the line as:

\RAS\Total Clients

If multiple matches are found, then each line will be displayed.

EXAMPLE 5

Option 5

This option will create a graph for the given counter.

E.g.: Enter counter name to print sample value: \Processor Information(*)\% Processor Performance

Enter number of samples: 5

Enter time interval (in seconds) between samples: 2

Data saved in file : PerfExample.blg

More from Sunil Siddharth