Branch: Tag:

2009-06-10

2009-06-10 12:48:15 by Martin Stjernholm <mast@lysator.liu.se>

Added log options $queue-time, $handle-time and $handle-cputime.

Rev: server/base_server/configuration.pike:1.679
Rev: server/base_server/prototypes.pike:1.253
Rev: server/base_server/roxen.pike:1.1033
Rev: server/protocols/http.pike:1.609

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2009, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.608 2009/06/05 09:11:14 grubba Exp $"; + constant cvs_version = "$Id: http.pike,v 1.609 2009/06/10 12:40:36 mast Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
2771:   {    REQUEST_WERR("HTTP: handle_request()");    TIMER_START(handle_request); +  +  queue_time = gethrtime() - queue_time; +    #ifdef MAGIC_ERROR    if(prestate->old_error)    {
2807:       MARK_FD("HTTP handling request");    -  array e; +  handle_time = gethrtime(); + #if constant(System.CPU_TIME_IS_THREAD_LOCAL) +  handle_vtime = gethrvtime(); + #endif +     mapping result; -  if(e= catch(result = conf->handle_request( this_object() ))) +  array e = catch(result = conf->handle_request( this_object() )); +  +  handle_time = gethrtime() - handle_time; + #if constant(System.CPU_TIME_IS_THREAD_LOCAL) +  handle_vtime = gethrvtime() - handle_vtime; + #endif +  +  if(e)    INTERNAL_ERROR( e );       else {
3372:    TIMER_END(parse_request);       REQUEST_WERR("HTTP: Calling roxen.handle()."); +  queue_time = gethrtime();    roxen.handle(handle_request);    })    {