Record bandwidth usage and request time in ASP.NET 4.0

I am writing an ASP.NET application that will monitor the bandwidth used, as well as the time taken by each request.

Since my application will be hosted on shared servers, so I want to do everything in ASP.NET itself, and not at the IIS level.

Although there is something called a performance counter, they talk about memory issues.

I want this total bandwidth consumed on a specific day. And which page takes how long?

Now I plan to write every query time and bandwidth consumed for each query in the Sql Server Database. Am I right or will I face some critical issues if this is done?

I searched for it for too long, but did not find what to do in my case?

Any help is appreciated.

thanks

EDIT

I want to show the bandwodth details and the time taken by the pages to download to the same site so that the administrator can see what is happening?

  • My web application will be hosted on a shared server
+7
source share
3 answers

Writing to a database on a busy site can cause other problems (and requires a well-proven server with good hardware.)

Instead, just turn on IIS logging, then analyze your logs with a tool like LogParser 2.2 (free)

Also check ASP.NET-oriented performance counters:

Related SO questions:

+2
source

You can see the mini profiler . The name of the project is mvc-mini-profiler, but in fact it also refers to asp.net. Although it does not determine how many frequency bands are used, you can easily configure it.

this is also a nuget package for this

+1
source

I was in the same situation and just encoded my solution. For a site with low traffic, as yours should be (shared hosting), SQL performance will not be a problem.

Just hook up the Application_Begin and Application_End events and register the URL and time between the two. To measure the size of responses, see http://msdn.microsoft.com/en-us/library/system.web.httpresponse.filter.aspx . This will not count HTTP headers, but they will not be particularly large.

+1
source

All Articles