Branch: Tag:

2015-10-15

2015-10-15 11:56:15 by Marcus Agehall <agehall@roxen.com>

Added logging for handler threads in the main server.

6:   // 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   //!
496: Inside #if 0
   })    werror (describe_backtrace (err));   #endif +  destruct(main_logger);    roxenloader.real_exit( exit_code ); // Now we die...   }   
879:       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 &&
896:    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;