try {
OutputPage ();
+ } catch (ThreadAbortException taex) {
+ ProcessError (taex);
+ Thread.ResetAbort ();
} catch (Exception e) {
Console.WriteLine ("Internal error: OutputPage threw an exception " + e);
} finally {
requests_total_counter.Increment ();
}
-
+
+ class Tim {
+ string name;
+ DateTime start;
+
+ public Tim () {
+ }
+
+ public Tim (string name) {
+ this.name = name;
+ }
+
+ public string Name {
+ get { return name; }
+ set { name = value; }
+ }
+
+ public void Start () {
+ start = DateTime.UtcNow;
+ }
+
+ public void Stop () {
+ Console.WriteLine ("{0}: {1}ms", name, (DateTime.UtcNow - start).TotalMilliseconds);
+ }
+ }
+
+ Tim tim;
+ [Conditional ("PIPELINE_TIMER")]
+ void StartTimer (string name)
+ {
+ if (tim == null)
+ tim = new Tim ();
+ tim.Name = name;
+ tim.Start ();
+ }
+
+ [Conditional ("PIPELINE_TIMER")]
+ void StopTimer ()
+ {
+ tim.Stop ();
+ }
+
//
// Events fired as described in `Http Runtime Support, HttpModules,
// Handling Public Events'
if (stop_processing)
yield return true;
+ StartTimer ("BeginRequest");
eventHandler = Events [BeginRequestEvent];
if (eventHandler != null) {
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
}
+ StopTimer ();
+ StartTimer ("AuthenticateRequest");
eventHandler = Events [AuthenticateRequestEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
+ StartTimer ("DefaultAuthentication");
if (DefaultAuthentication != null)
foreach (bool stop in RunHooks (DefaultAuthentication))
yield return stop;
+ StopTimer ();
#if NET_2_0
+ StartTimer ("PostAuthenticateRequest");
eventHandler = Events [PostAuthenticateRequestEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
#endif
+ StartTimer ("AuthorizeRequest");
eventHandler = Events [AuthorizeRequestEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
#if NET_2_0
+ StartTimer ("PostAuthorizeRequest");
eventHandler = Events [PostAuthorizeRequestEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
#endif
+ StartTimer ("ResolveRequestCache");
eventHandler = Events [ResolveRequestCacheEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
#if NET_2_0
+ StartTimer ("PostResolveRequestCache");
eventHandler = Events [PostResolveRequestCacheEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
+ StartTimer ("MapRequestHandler");
// As per http://msdn2.microsoft.com/en-us/library/bb470252(VS.90).aspx
eventHandler = Events [MapRequestHandlerEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
#endif
+ StartTimer ("GetHandler");
// Obtain the handler for the request.
IHttpHandler handler = null;
try {
ProcessError (e);
}
+ StopTimer ();
if (stop_processing)
yield return true;
#if NET_2_0
+ StartTimer ("PostMapRequestHandler");
eventHandler = Events [PostMapRequestHandlerEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
#endif
+ StartTimer ("AcquireRequestState");
eventHandler = Events [AcquireRequestStateEvent];
if (eventHandler != null){
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
}
+ StopTimer ();
#if NET_2_0
+ StartTimer ("PostAcquireRequestState");
eventHandler = Events [PostAcquireRequestStateEvent];
if (eventHandler != null){
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
}
+ StopTimer ();
#endif
//
// ReleaseRequestState, so the code below jumps to
// `release:' to guarantee it rather than yielding.
//
+ StartTimer ("PreRequestHandlerExecute");
eventHandler = Events [PreRequestHandlerExecuteEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
if (stop)
goto release;
+ StopTimer ();
#if TARGET_J2EE
}
#endif
+ StartTimer ("ProcessRequest");
try {
context.BeginTimeoutPossible ();
if (handler != null){
in_begin = false;
context.EndTimeoutPossible ();
}
+ StopTimer ();
#if TARGET_J2EE
if (doProcessHandler) {
yield return false;
// These are executed after the application has returned
+ StartTimer ("PostRequestHandlerExecute");
eventHandler = Events [PostRequestHandlerExecuteEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
if (stop)
goto release;
+ StopTimer ();
release:
+ StartTimer ("ReleaseRequestState");
eventHandler = Events [ReleaseRequestStateEvent];
if (eventHandler != null){
#pragma warning disable 219
}
#pragma warning restore 219
}
+ StopTimer ();
if (stop_processing)
yield return true;
#if NET_2_0
+ StartTimer ("PostReleaseRequestState");
eventHandler = Events [PostReleaseRequestStateEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
#endif
+ StartTimer ("Filter");
if (context.Error == null)
context.Response.DoFilter (true);
+ StopTimer ();
+ StartTimer ("UpdateRequestCache");
eventHandler = Events [UpdateRequestCacheEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
#if NET_2_0
+ StartTimer ("PostUpdateRequestCache");
eventHandler = Events [PostUpdateRequestCacheEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
+ StartTimer ("LogRequest");
eventHandler = Events [LogRequestEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
+ StartTimer ("PostLogRequest");
eventHandler = Events [PostLogRequestEvent];
if (eventHandler != null)
foreach (bool stop in RunHooks (eventHandler))
yield return stop;
+ StopTimer ();
#endif
+ StartTimer ("PipelineDone");
PipelineDone ();
+ StopTimer ();
}
return ret;
#if NET_2_0
- HttpHandlersSection httpHandlersSection = (HttpHandlersSection) WebConfigurationManager.GetSection ("system.web/httpHandlers");
+ HttpHandlersSection httpHandlersSection = (HttpHandlersSection) WebConfigurationManager.GetSection ("system.web/httpHandlers");
ret = httpHandlersSection.LocateHandler (verb, url);
#else
HandlerFactoryConfiguration factory_config = (HandlerFactoryConfiguration) HttpContext.GetAppConfig ("system.web/httpHandlers");