tobinharris
tobinharris

Reputation: 2559

Recording ASP.NET MVC performance metrics

We want to time how long certain actions run for in an ASP.NET MVC application. We're using ActionFilters to start and stop a timer each time a contoller action is invoked. The result is a small dataset a bit like this:

{
   ContollerName: 'Account',
   ActionName: 'Index',
   ExecutionDuration: 287,
   TimeRecorded: '2009-07-02 17:34:54'
}

We want to beam this data off to a Web service so that we can collect and later analyse it. For example, we could find out that Account/Index is the slowest action in the application.

The thing is, if we're getting 1,000 requests per second, making 1,000 service calls per second isn't very clever; it will harm application performance.

Is there any way of doing buffered service calls? Or are there any libraries out there for doing this? Or is our architecture all wrong!?

Thoughts appreciated.

Upvotes: 2

Views: 844

Answers (2)

Dusda
Dusda

Reputation: 3367

I don't usually just link answers to questions here, but the guy at whiletrue.com did a really good job of profiling MVC here. His slide show covers just about everything he did to set it up.

http://blog.whiletrue.com/2009/04/aspnet-mvc-performance/

Upvotes: 3

jvanderh
jvanderh

Reputation: 2955

You could create a controller with an action that can take those four values and simply hit your own site and in that controller queue up the information to a database. Then have a different process batch submit the information to you web service.

Upvotes: 0

Related Questions