-6

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

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
esa
  • 87
  • 3
  • 9
  • We're not here to write it for you. What have you tried? – Corey Ogburn Nov 05 '12 at 17:30
  • It's called "benchmarking". Don't waste your energy reinventing the wheel unless you have a highly specialized value or performance rubric you are trying to test. – lc. Nov 05 '12 at 17:31
  • My suggestion is to use Google and work it out. – Neville Kuyt Nov 05 '12 at 17:31
  • 1
    Why so many negative votes? Op is simply asking for any API if it is there, he is not asking anyone to do job for him and work for hours, he is asking guidelines, such negative votes are simply destroying interest of using Stack Overflow, I have stopped answering questions because of stupid people putting negative votes !!! – Akash Kava Nov 05 '12 at 17:32
  • @AkashKava u r right..new so users tend to feel `rude` due to this..his question is not open ended.. – Anirudha Nov 05 '12 at 17:33
  • 2
    @AkashKava Asking for an API is effectively a shopping question, and those [aren't considered acceptable on SO](http://blog.stackoverflow.com/2010/11/qa-is-hard-lets-go-shopping/). In short, these types of questions tend to elicit lots of spam or low quality answers and rarely result in high quality comprehensive answers. They are also usually localized and don't stand the test of time. The question should therefore be closed. As for the downvotes, I can only guess, but I'd say that most of them are because the question fails to demonstrate research effort. – Servy Nov 05 '12 at 17:33
  • @Servy, You and SO are not government, further more whether this fits or does not fit in guideline is also subjected to specific domain, you may be too intelligent and God in computer science, but there are more ordinary people they need help. – Akash Kava Nov 05 '12 at 17:35
  • 2
    @AkashKava SO isn't *obligated* to answer every question in the entire world. The creators of the site were smart enough to realize that one of the major problems with their competition is that they allowed everything. By restricting the scope of allowable questions to those that they know can be answered with a high standard of quality, the site becomes a substantially more useful resource. I'm merely helping to enforce the guidelines that have already been defined by others and inform you of what they are. If you would like to discuss them in detail, or have them changed, go to meta. – Servy Nov 05 '12 at 17:38
  • @Servy, well we will see till how some other competitor kills SO, If you wanted to build wikipedia of Programming, then we will leave using SO very soon, and am sure, you all moderators with very high points can keep on using SO, and we ordinary people will go where we can get our solutions. – Akash Kava Nov 05 '12 at 17:40
  • @Servy I had no intention to ask anyone to write a code for me... I believe everyone has been starter once in something and for me as a starter in coding, I couldn't find the right API amongs tons of them availbale on the internet. And I think in my question, I specifically mentioned that I am looking for suggestions and not codes... I think I am not the one who is spaming and there are others spamming me with comments which get me nowhere... – esa Nov 05 '12 at 17:49
  • @AkashKava I'm not a moderator, although I do have enough reputation to have unlocked the majority of permissions unlockable through reputation. SO relies on community moderation; it has a very small number of moderators considering the size of the community because of the fact that non-moderators are able to do so much when it comes to maintaining the site (i.e. editing posts, closing/opening questions, deleting questions/answers, etc.). As for you leaving; there are already a *lot* of other sites that allow almost any question and don't moderate jack. You don't need to wait for a new site. – Servy Nov 05 '12 at 17:50
  • @Servy Anyhow, I enjoy using Stackoverflow and have always recommended it to many of my friends... Please also understand that you shouldn't be too harsh on people sometimes as they are here only for learning and teaching is always about giving the clues and if the guy is smart enough, he will find a way to solve his problem... – esa Nov 05 '12 at 17:51
  • 1
    @iSi I know you're not asking for code, I know that you are asking for an API. I explained to you exactly why that type of question isn't allowed on SO. Explaining why a question is about to be closed (or has been, as is the case now) is considered an appropriate use of comments. If you would rather me not explain why your question is not considered appropriate here on SO then I won't spend further time or effort *helping you*. – Servy Nov 05 '12 at 17:52
  • @Servy don't take it personally... I didn't mean you when I said people spamming me... ANYWAYS GUYS, let's finish this... I got the rules now and let's get back to work... Thanks to all of you... – esa Nov 05 '12 at 17:56

2 Answers2

1

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

Eric Fleischman
  • 1,168
  • 6
  • 8
0

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.

Frank Thomas
  • 2,434
  • 1
  • 17
  • 28