I’m looking for a way to measure each step of a (HTTP) web request in .NET similar to Firebug’s network waterfall timeline or Pingdom.com’s full page test.
Both share a lowest common denominator of showing time spans required for each request to:
- Lookup DNS
- Connect
- Send the request
- Wait for response
- Receive response
Obviously I can use a timer to measure the web requests GetResponse() and GetResponseStream() methods, but I’m looking for a way to be as granular as possible with as many measurements as possible.
What’s the best way in .NET to measure each stage of the request life cycle?
Thanks!
You might look at ETW tracing to do this. AFAIK ETW tracing output a ton of information from many .NET APIs. At least I see it all the time when I use reflector to browse the .NET framework.
If ETW cannot do this I am pretty sure you can hook many relevant points in the pipeline: