Could you please introduce how the MiniProfiler is implemented?

Thanks for providing such great tool for ASP.NET web site troubleshooting.
Could you please give some introductions on the following points?

  1. what’s the architecture of the this tool?
  2. how is the tool working on asp.net website?
  3. could you please give some hints to read the source code?

I’m interested in how the tool is implemented and have no clue when i’m reading the source code.
Hoping to have the concept of how the tool is implemented and use it right in my project.