Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.1105 2012/01/26 11:12:10 mast Exp $"; + constant cvs_version="$Id$";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:489: Inside #if 0
   // SIGTERM or SIGINT to the start script (which include the stop    // action of the init.d script).    if (mixed err = catch {    if (exit_code && !once_mode)    report_notice("Restarting Roxen.\n");    else    report_notice("Shutting down Roxen.\n");    })    werror (describe_backtrace (err));   #endif +  destruct(main_logger);    roxenloader.real_exit( exit_code ); // Now we die...   }      private int shutdown_recurse;      // Shutdown Roxen   // exit_code = 0 True shutdown   // exit_code = -1 Restart   private void low_shutdown(int exit_code)   {
Roxen.git/server/base_server/roxen.pike:872:    if(arrayp(h=handle_queue->read()) && h[0]) {    THREAD_WERR(sprintf("Handle thread [%O] calling %s",    id, debug_format_queue_task (h)));    set_locale();    busy_threads++;    thread_flagged_as_busy = 1;    handler_num_runs++;       int start_hrtime = gethrtime();    thread_task_start_times[this_thread()] = start_hrtime; +  +  mapping log_entry = ([ +  "thread_id" : sprintf("0x%X", this_thread()->id_number()), +  "event" : "BEGIN_HANDLE", +  "hrtime" : start_hrtime, +  ]); +  +  object tmp = functionp(h[0]) && function_object(h[0]); +  if (tmp && has_index(tmp, "request_uuid")) { +  log_entry->rid = tmp->request_uuid; +  } +  main_logger->log(log_entry); +     float handler_vtime = gauge {   #ifndef NO_SLOW_REQ_BT    if (h[0] != bg_process_queue &&    // Leave out bg_process_queue. It makes a timeout on    // every individual job instead.    (monitor = slow_req_monitor) && slow_req_timeout > 0.0) {    call_out = monitor->call_out (dump_slow_req, slow_req_timeout,    this_thread(), slow_req_timeout);    h[0](@h[1]);    monitor->remove_call_out (call_out);    }    else   #endif    {    h[0](@h[1]);    }    }; -  float handler_rtime = (gethrtime() - start_hrtime)/1E6; +  int end_hrtime = gethrtime(); +  log_entry->event = "END_HANDLE"; +  log_entry->hrtime = end_hrtime; +  log_entry->real_time = end_hrtime - start_hrtime; +  main_logger->log(log_entry); +  +  float handler_rtime = (end_hrtime - start_hrtime)/1E6;    thread_task_start_times[this_thread()] = 0;       h=0;    busy_threads--;    thread_flagged_as_busy = 0;    if (handler_rtime > 0.01) handler_num_runs_001s++;    if (handler_rtime > 0.05) handler_num_runs_005s++;    if (handler_rtime > 0.15) handler_num_runs_015s++;    if (handler_rtime > 0.50) handler_num_runs_05s++;    if (handler_rtime > 1.00) handler_num_runs_1s++;