Search code examples
c#performanceperformance-testingevaluationevaluator

Performance Evaluator in C#


I need to develop an evaluation tool using C# that will run on the system for hours and then will show the overal performance of the system.

The system is supposed to run a service and we want to evaluate how this service is affecting the performance of the system. Will be great if I could use the performance counters that are available in "Windows Performance Monitor"... I'm not sure if there is any API available for developers to use them.

I was just looking for suggestions...

Thanks


Solution

  • If it were me, I'd use perfmon. The advantages are:

    • Well known data archiving model that offers multiple formats.
    • Existing tooling to slice and dice the data, including visualization.
    • Integrates with other systems if the client cares (ie lets them suck the data in to other performance tooling).
    • Someone else's code. :)

    You can wrap perfmon and invoke it programatically if you want. Worst case just invoke it via the command line and start/stop collection that way.

    Of course you can also expose your own performance counters for app specific stuff too. There are loads of APIs for this for just about every programming environment I can think of on Windows, including of course C#.