Browse Source

New state variable top_job_fifo_size.

default 2 years ago
parent
commit
d05399986d
2 changed files with 4 additions and 0 deletions
  1. 3 0
      httpd.c
  2. 1 0
      snac.h

+ 3 - 0
httpd.c

@@ -457,6 +457,9 @@ void job_post(const xs_val *job, int urgent)
 
         p_state->job_fifo_size++;
 
+        if (p_state->job_fifo_size > p_state->top_job_fifo_size)
+            p_state->top_job_fifo_size = p_state->job_fifo_size;
+
         /* unlock the mutex */
         pthread_mutex_unlock(&job_mutex);
 

+ 1 - 0
snac.h

@@ -50,6 +50,7 @@ typedef struct {
     int use_fcgi;           /* FastCGI use on/off */
     time_t srv_start_time;  /* start time */
     int job_fifo_size;      /* job fifo size */
+    int top_job_fifo_size;  /* maximum job fifo size seen */
     int n_threads;          /* number of configured threads */
     enum { THST_WAIT, THST_IN, THST_QUEUE, THST_STOP } th_state[MAX_THREADS];
 } srv_state;