diff --git a/checkin_notes b/checkin_notes index f8f21b6ff0..f640f2b209 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6021,3 +6021,16 @@ Janus 4 May 2005 forum.inc db_forum.inc (new) +Bruce 4 May 2005 + - log execution times for two cgi scripts (scheduler and + file_upload_handler) + - better print format for timezone + + sched/ + sched_util.h + sched_util.C + sched_timezone.C + main.C + sched_send.C + file_upload_handler.C + diff --git a/sched/file_upload_handler.C b/sched/file_upload_handler.C index 7e0d81eb61..51768607f6 100644 --- a/sched/file_upload_handler.C +++ b/sched/file_upload_handler.C @@ -466,6 +466,8 @@ int handle_request(FILE* in, R_RSA_PUBLIC_KEY& key) { return return_error(ERR_PERMANENT, "no command"); } + log_messages.printf(SCHED_MSG_LOG::DEBUG, "run time %d seconds\n", elapsed_time()); + return retval; } @@ -484,9 +486,9 @@ int get_key(R_RSA_PUBLIC_KEY& key) { void boinc_catch_signal(int signal_num) { log_messages.printf(SCHED_MSG_LOG::CRITICAL, - "FILE=%s (%.0f bytes left) IP=%s caught signal %d [%s]\n", + "FILE=%s (%.0f bytes left) IP=%s caught signal %d [%s] run time %d seconds\n", this_filename, bytes_left, get_remote_addr(), - signal_num, strsignal(signal_num) + signal_num, strsignal(signal_num), elapsed_time() ); // there is no point in trying to return an error. At this point Apache has broken @@ -516,6 +518,7 @@ int main() { int retval; R_RSA_PUBLIC_KEY key; char log_path[256]; + elapsed_time(); installer(); diff --git a/sched/main.C b/sched/main.C index e9f0cf8db6..43032cfd79 100644 --- a/sched/main.C +++ b/sched/main.C @@ -106,8 +106,8 @@ void debug_sched(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& sreply, const char *t // void sigterm_handler(int signo) { log_messages.printf(SCHED_MSG_LOG::CRITICAL, - "BOINC scheduler (pid=%d) caught signal %d. Exit(1)ing\n", - (int)getpid(), signo + "Caught signal %d [scheduler ran %d seconds]. Exit(1)ing\n", + signo, elapsed_time() ); fflush(NULL); exit(1); @@ -151,6 +151,9 @@ int main() { int length=-1; log_messages.pid = getpid(); + // initialized timer + elapsed_time(); + // install a signal handler that catches SIGTERMS sent by Apache if the cgi // times out. // diff --git a/sched/sched_send.C b/sched/sched_send.C index fc3a1ffdf4..561ecadc18 100644 --- a/sched/sched_send.C +++ b/sched/sched_send.C @@ -881,8 +881,8 @@ int send_work( #endif log_messages.printf( - SCHED_MSG_LOG::NORMAL, "[HOST#%d] Sent %d results\n", - reply.host.id, reply.wreq.nresults + SCHED_MSG_LOG::NORMAL, "[HOST#%d] Sent %d results [scheduler ran %d seconds]\n", + reply.host.id, reply.wreq.nresults, elapsed_time() ); if (reply.wreq.nresults == 0) { diff --git a/sched/sched_timezone.C b/sched/sched_timezone.C index 5948325982..c1ca5061ef 100644 --- a/sched/sched_timezone.C +++ b/sched/sched_timezone.C @@ -160,7 +160,7 @@ URLTYPE* read_download_list() { ); for (i=0; i