Domanda

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

È stato utile?

Soluzione

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#.

Altri suggerimenti

I would strongly suggest you use an existing option like automating the collection of WPM statistics.

otherwise C# may not be the best choice since hardware is almost completely abstracted away from the code by the runtime. additionally the application may require sufficient resources and time to contaminate your results. usually the performace cost between C++ and C# is neglible, but in this case could be a problem.

Good luck.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top