开发者

C# ASP.NET 2.0 Metrics Dashboard

I want create some type of ASP.NET (C# 2.0) Metrics class to help monitor the performance of a production web application. I am somewhat familiar with the 2.0 Health Monitoring and that is not what I am looking for (I don't think anyway). I would rather have a dashboard that gives me a snap shot as opposed a log or list of events. I would appreciate any feedback from the community. So even if you don't have a specific answer, feel free to add your input to any part and don't feel like you have to provide input on the whole thing. Thanks in advance!

Below are some of the things I would like to monitor. Values should be specific to the application and not IIS.

  1. Number of open sessions
  2. Hits per hour
  3. Oldest session
  4. Amount of allocated memory and usage
  5. **Average runtime spent in each (or a given) function.
  6. Last exception (handled or un-handled)
  7. Bandwidth utilization (is that even possible at the application level?)

**For number 5, I was thinking about using some type of stopwatch开发者_运维问答 class. Each function I want to monitor will call start/stop as it begins and ends its execution. However that seems horribly ugly to me. Is there a way to do this without a stopwatch class? Can something in the Reflections class help with this?

Does something like this already exist? I have done a fair amount of Googling but can't find exactly what I am looking for.

Can you recommend any other metrics I should look at?


It sounds like much of what you're looking for can be captured with Windows Performance Counters. You could read them from your dashboard page, and display them in HTML.

You can also create custom counters for any app-specific data. One of my favorites is to measure how long out of process calls take, and count the number of times they exceed some pre-determined threshold, to look for performance problems or regressions.


You should be able to read Windows performance counters to get most of this information. Bandwidth utilization is hard at the application level. I ended up building a sort of counter into my application to track bandwidth. I'm sure it could be done more efficiently by going down lower in the stack, but I just needed something quick and dirty anyway.


Try a product (service?) called NewRelic. I am not affiliated with them in any way, but their service is really great and has a free tier you can use to get started.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜