buddybubble
buddybubble

Reputation: 1319

.net Profiler to collect long term metrics?

We have a Client/Server Application and I'd like to profile both of them to create Metrics like "The average Login Time was xx ms with xxx being max, x being min and a total of xx Logins since yyyy" and so on.

I know the Equatec and ANTS profilers (which I both like a lot). But I think they dont provide the functionality I'd need.

Of course, I could write the necessary functions myself, but I think as ANTS or Equatec can do that on their own pretty good, there must be some way to use that functionality.

What I need:

This does not have to come for free, but having a trial for testing is a must.

Upvotes: 2

Views: 366

Answers (2)

Louis Somers
Louis Somers

Reputation: 2964

Here are a few options that I could think of right now:

  1. Write your own code specifically timing the functions you want to profile (obvious easiest option).
  2. Use performance counters (System.Diagnostics.PerformanceCounter).
  3. Roll your own profiler using the .NET Profiling API
  4. Use the low level built in OS profiler called Xperf from the performance toolkit.

Edit: How could I forget this little gem!

MiniProfiler can be wrapped around your code like this:

var profiler = MiniProfiler.Current; // it's ok if this is null
using (profiler.Step("Doing complex stuff")){
    using (profiler.Step("Step A"))
    { // something more interesting here
        Thread.Sleep(100);
    }

    using (profiler.Step("Step B"))
    { // and here
        Thread.Sleep(250);
    }
}

Upvotes: 0

weismat
weismat

Reputation: 7411

Profilers are more code/function centric and have a large performance impact. Plus it will be impossible to roll out the profiler with your code to your users.
I think you should look at using a logging framework like log4net for your code and then configure the logging to save the results into a database which you can use to analyse the performance figures.

Upvotes: 1

Related Questions