Commit 0aa9059d authored by Geoff Simmons's avatar Geoff Simmons

trackrdrd: added stats len_overflow and data_overflow to monitoring

           main thread uses signal (not broadcast) to wake up a thread
           waiting for data
vcl:       unsetting cookie in 204 response (needs to be anonymized)
parent 5dc4e6c2
......@@ -144,8 +144,8 @@ DATA_Init(void)
datatable init_tbl =
{ .magic = DATATABLE_MAGIC, .len = entries, .collisions = 0,
.insert_probes = 0, .find_probes = 0, .seen = 0, .open = 0, .done = 0,
.submitted = 0, .occ_hi = 0, .data_hi = 0, .entry = entryptr,
.buf = bufptr };
.len_overflows = 0, .data_overflows = 0, .submitted = 0, .occ_hi = 0,
.data_hi = 0, .entry = entryptr, .buf = bufptr };
memcpy(&tbl, &init_tbl, sizeof(datatable));
for (int i = 0; i < entries; i++) {
......@@ -171,8 +171,10 @@ dataentry
while (++probes <= tbl.len && tbl.entry[INDEX(h)].state != DATA_EMPTY)
h++;
tbl.insert_probes += probes;
if (probes > tbl.len)
if (probes > tbl.len) {
tbl.len_overflows++;
return(NULL);
}
return(&tbl.entry[INDEX(h)]);
}
......
......@@ -70,12 +70,13 @@ void
}
LOG_Log(LOG_INFO,
"Data table: len=%d collisions=%d insert_probes=%d find_probes=%d "
"open=%d done=%d load=%.2f occ_hi=%d seen=%d submitted=%d "
"sent=%d failed=%d wait_qfull=%d data_hi=%d",
"open=%d done=%d load=%.2f len_overflows=%d data_overflows=%d "
"occ_hi=%d seen=%d submitted=%d sent=%d failed=%d wait_qfull=%d "
"data_hi=%d",
tbl.len, tbl.collisions, tbl.insert_probes, tbl.find_probes,
tbl.open, tbl.done, 100.0 * ((float) tbl.open + tbl.done) / tbl.len,
tbl.occ_hi, tbl.seen, tbl.submitted, tbl.sent, tbl.failed,
tbl.wait_qfull, tbl.data_hi);
tbl.len_overflows, tbl.data_overflows, tbl.occ_hi, tbl.seen,
tbl.submitted, tbl.sent, tbl.failed, tbl.wait_qfull, tbl.data_hi);
WRK_Stats();
}
......
......@@ -114,7 +114,7 @@ submit(unsigned xid)
AZ(pthread_mutex_lock(&spmcq_nonfull_lock));
AZ(pthread_cond_wait(&spmcq_nonfull_cond, &spmcq_nonempty_lock));
}
AZ(pthread_cond_broadcast(&spmcq_nonempty_cond));
AZ(pthread_cond_signal(&spmcq_nonempty_cond));
tbl.submitted++;
}
......@@ -223,6 +223,7 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
"%s: Data too long, XID=%d, current length=%d, "
"DISCARDING data=[%.*s]", VSL_tags[tag], xid, entry->end,
datalen, data);
tbl.data_overflows++;
break;
}
......@@ -491,9 +492,13 @@ child_main(struct VSM_data *vd, int endless)
term = 0;
/* XXX: Varnish restart? */
/* XXX: TERM not noticed until request received */
while (VSL_Dispatch(vd, OSL_Track, NULL))
while (VSL_Dispatch(vd, OSL_Track, NULL) > 0)
if (term || !endless)
break;
else {
LOG_Log0(LOG_WARNING, "Log read interrupted, continuing");
continue;
}
WRK_Halt();
WRK_Shutdown();
......
......@@ -113,6 +113,8 @@ typedef struct {
unsigned seen; /* Records (ReqStarts) seen */
unsigned open;
unsigned done;
unsigned len_overflows;
unsigned data_overflows;
unsigned submitted; /* Records submitted */
unsigned sent; /* Records sent to MQ */
unsigned failed; /* MQ send fails */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment