src/hg/qa/apacheMonitor.c 1.15

1.15 2009/03/16 21:40:39 angie
Always show up to 20 most recent error 500's.
Index: src/hg/qa/apacheMonitor.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/qa/apacheMonitor.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -b -B -U 4 -r1.14 -r1.15
--- src/hg/qa/apacheMonitor.c	2 Mar 2009 17:53:06 -0000	1.14
+++ src/hg/qa/apacheMonitor.c	16 Mar 2009 21:40:39 -0000	1.15
@@ -250,12 +250,13 @@
 struct sqlResult *sr;
 char **row;
 int startTime = secondsNow - (minutes * 60);
 
-if (status500 <= 20)
+if (status500)
     {
-    safef(query, sizeof(query), "select remote_host, machine_id, request_uri, referer from access_log "
-                                "where time_stamp > %d and status = 500\n", startTime);
+    safef(query, sizeof(query),
+	  "select remote_host, machine_id, request_uri, referer from access_log "
+	  "where time_stamp > %d and status = 500 order by timestamp desc limit 20\n", startTime);
     sr = sqlGetResult(conn, query);
     while ((row = sqlNextRow(sr)) != NULL)
         verbose(1, "%s\t%s\t%s\t%s\n", row[0], row[1], row[2], row[3]);
     sqlFreeResult(&sr);