Question

I'm trying to write a web part that will log some performance metrics to the database when the user loads the page that the web part is placed on. Although I can write to the database with no problems I'm unsure how to capture any relevant performance information.

I've looked at ASP.NET trace but it doesn't look like you can embed this in a web part - are there any other options available to me?

At minimum I hope to be able to capture the page load time so I can benchmark it over time and compare different users against each other.

edit: Although this will only capture part of the page load event I'd still like to know how to do this (degregation between sites, even over partial events will still give me the information I seek provided those samples are limited in all cases).

Was it helpful?

Solution

I currently use MiniProfiler of StackOverflow for my ASP.NET MVC site. I strongly recommend that.

OTHER TIPS

Trying to measure things in a webpart could work, but it only captures part of page lifecycle, since webpart is loaded only somewhere in the middle of each page load.

If you "own" the SharePoint server you are talking about and are able to deploy your own HttpModule, this could let you collect better performance data.

The issue I see with this approach is that the Web Part won't see the whole page load, it'll only run after several scripts and stylesheets, as well as the page header and left menu, have already been loaded.

In my opinion it would make more sense to have your performance metrics directly in the Master page. Or if you want to use Web Parts, then use a Page Viewer Web Part that is external to your current page and will load it in an iframe.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top