views:

144

answers:

4

Hi,

I'm wondering if there are tools, or if there is a programmatic approach for mapping the execution of a web application ?

To clarify, the company I work for develop a CRM product that is based around the concept of Dynamically loading ASCX controls on a page-by-page basis.

What I would like to see is a map to see from the request start, to the page render, which classes are instantiated and which methods are entered; seeing the arguments that are passed along too would be good.

I know in my heart that we have some serious cyclomatic complexity problems and I want to be able to generate a graph or something that I can put in-front of my development manager and say, here - now please let me fix it!

I've seen the Code metrics plugin for reflector, and of course NDepend, but I need something that will attach to a live process, even if I need to decorate with attributes. That way I can see the different execution depending on what page and what modules are loaded.

I'd be grateful for any advice!

A: 

Are you doing this for debugging purposes? You could turn the built in trace on, by adding trace="true" in the @Page declarative in your aspx (or in web.config, for the entire app), and then see this detailed information as you load the page.

David Hedlund
Trace tells you which controls were loaded, but it doesnt trace method invocations and parameter values (unless of course Russ is happy to put a Trace.Write(..function + params..) at the start of every function?)
Adam Pope
That might prove a touch awkward, but it does provide some information that could be useful.
Russ C
+1  A: 

try to use AntsProfiler

B-Rain
I tried Ants a few years ago, but it wouldn't dig into the code behind the ASCX controls that are loaded by LoadControl(...)Can't hurt to try it again though, lot of water under the bridge since then.
Russ C
A: 

Try dotTrace

Patrick Smacchia - NDepend dev
+1  A: 

Turns out that PostSharp was the best fit for this problem. It's default example of weaving a Trace into every method in this voluminous assembly gave me the output I was after.

Thanks to everyone for their input though, it was nice to see at least that Ants has grown a lot since I tried it last; it appears to pick up our dynamically loaded user controls now!

Russ C