Commit 89deca72 authored by Geoff Simmons's avatar Geoff Simmons

rename config param maxdone as max.records

parent 799db78c
......@@ -128,14 +128,14 @@ CONF_Add(const char *lval, const char *rval)
confUnsigned("thread.restarts", thread_restarts);
confUnsigned("monitor.interval", monitor_interval);
if (strcmp(lval, "maxdone") == 0) {
if (strcmp(lval, "max.records") == 0) {
unsigned int i;
int err = conf_getUnsignedInt(rval, &i);
if (err != 0)
return err;
config.maxdone = i;
config.max_records = i;
if (!qlen_configured)
config.qlen_goal = config.maxdone >> 1;
config.qlen_goal = config.max_records >> 1;
return(0);
}
......@@ -206,7 +206,7 @@ CONF_Init(void)
config.syslog_facility = LOG_LOCAL0;
config.monitor_interval = 30;
config.monitor_workers = false;
config.maxdone = DEF_MAXDONE;
config.max_records = DEF_MAX_RECORDS;
config.maxdata = DEF_MAXDATA;
config.maxkeylen = DEF_MAXKEYLEN;
config.qlen_goal = DEF_QLEN_GOAL;
......@@ -257,7 +257,7 @@ CONF_Dump(int level)
confdump(level, "monitor.interval = %u", config.monitor_interval);
confdump(level, "monitor.workers = %s",
config.monitor_workers ? "true" : "false");
confdump(level, "maxdone = %u", config.maxdone);
confdump(level, "max.records = %u", config.max_records);
confdump(level, "maxdata = %u", config.maxdata);
confdump(level, "maxkeylen = %u", config.maxkeylen);
confdump(level, "qlen.goal = %u", config.qlen_goal);
......
......@@ -73,11 +73,11 @@ DATA_Init(void)
* we want enough space to accomodate all open and done records
*
*/
entrytbl = (dataentry *) calloc(config.maxdone, sizeof(dataentry));
entrytbl = (dataentry *) calloc(config.max_records, sizeof(dataentry));
if (entrytbl == NULL)
return(errno);
buf = (char *) calloc(config.maxdone, bufsize);
buf = (char *) calloc(config.max_records, bufsize);
if (buf == NULL) {
free(entrytbl);
return(errno);
......@@ -88,14 +88,14 @@ DATA_Init(void)
global_nfree = 0;
for (unsigned i = 0; i < config.maxdone; i++) {
for (unsigned i = 0; i < config.max_records; i++) {
entrytbl[i].magic = DATA_MAGIC;
entrytbl[i].data = &buf[i * bufsize];
entrytbl[i].key = &buf[(i * bufsize) + config.maxdata];
VSTAILQ_INSERT_TAIL(&freehead, &entrytbl[i], freelist);
global_nfree++;
}
assert(global_nfree == config.maxdone);
assert(global_nfree == config.max_records);
assert(VSTAILQ_FIRST(&freehead));
atexit(data_Cleanup);
......@@ -152,7 +152,7 @@ DATA_Return_Freelist(struct freehead_s *returned, unsigned nreturned)
void
DATA_Dump(void)
{
for (int i = 0; i < config.maxdone; i++) {
for (int i = 0; i < config.max_records; i++) {
dataentry *entry = &entrytbl[i];
if (!OCCUPIED(entry))
......
......@@ -63,7 +63,7 @@ log_output(void)
LOG_Log(LOG_INFO, "Data table: len=%u occ=%u occ_hi=%u occ_hi_this=%u "
"global_free=%u",
config.maxdone, occ, occ_hi, occ_hi_this, global_nfree);
config.max_records, occ, occ_hi, occ_hi_this, global_nfree);
/* Eliminate the dependency of trackrdrd.o for unit tests */
#ifndef TEST_DRIVER
......
......@@ -82,7 +82,7 @@ SPMCQ_Enq(dataentry *ptr)
{
AZ(pthread_mutex_lock(&spmcq_lock));
#if 0
assert(enqs - deqs < config.maxdone);
assert(enqs - deqs < config.max_records);
#endif
enqs++;
VSTAILQ_INSERT_TAIL(&enq_head, ptr, spmcq);
......
......@@ -21,7 +21,7 @@ CMD="../trackrdrd -D -f varnish.binlog -l - -d -c test.conf"
# the user running it
CKSUM=$( $CMD | sed -e 's/\(initializing\) \(.*\)/\1/' | sed -e 's/\(Running as\) \([a-zA-Z0-9]*\)$/\1/' | grep -v 'Not running as root' | cksum)
if [ "$CKSUM" != '2726228080 249605' ]; then
if [ "$CKSUM" != '3569206281 249613' ]; then
echo "ERROR: Regression test incorrect log cksum: $CKSUM"
exit 1
fi
......
......@@ -2,7 +2,7 @@
log.file = /tmp/trackrdrd.log
pid.file = trackrdrd.pid
maxdata = 4096
maxdone = 1024
max.records = 1024
monitor.interval = 0
nworkers = 1
mq.module = ../mq/file/.libs/libtrackrdr-file.so
......
......@@ -72,7 +72,7 @@ getConfigContent(void)
confdump("syslog.facility = %s", config.syslog_facility_name);
confdump("monitor.interval = %u", config.monitor_interval);
confdump("monitor.workers = %s", config.monitor_workers ? "true" : "false");
confdump("maxdone = %u", config.maxdone);
confdump("max.records = %u", config.max_records);
confdump("maxdata = %u", config.maxdata);
confdump("maxkeylen = %u", config.maxkeylen);
confdump("qlen.goal = %u", config.qlen_goal);
......
......@@ -51,13 +51,13 @@ static char
printf("... testing data table initialization\n");
config.maxdone = DEF_MAXDONE;
config.max_records = DEF_MAX_RECORDS;
config.maxdata = DEF_MAXDATA;
config.maxkeylen = DEF_MAXKEYLEN;
err = DATA_Init();
VMASSERT(err == 0, "DATA_Init: %s", strerror(err));
for (int i = 0; i < config.maxdone; i++) {
for (int i = 0; i < config.max_records; i++) {
MCHECK_OBJ_NOTNULL(&entrytbl[i], DATA_MAGIC);
MASSERT(!OCCUPIED(&entrytbl[i]));
MAZ(entrytbl[i].hasdata);
......@@ -80,7 +80,7 @@ static const char
printf("... testing data write and read\n");
for (int i = 0; i < config.maxdone; i++) {
for (int i = 0; i < config.max_records; i++) {
memset(entrytbl[i].data, 'd', DEF_MAXDATA);
memset(entrytbl[i].key, 'k', DEF_MAXKEYLEN);
}
......@@ -88,7 +88,7 @@ static const char
memset(data, 'd', DEF_MAXDATA);
memset(key, 'k', DEF_MAXKEYLEN);
for (int i = 0; i < config.maxdone; i++) {
for (int i = 0; i < config.max_records; i++) {
MASSERT(memcmp(entrytbl[i].data, data, DEF_MAXDATA) == 0);
MASSERT(memcmp(entrytbl[i].key, key, DEF_MAXKEYLEN) == 0);
}
......@@ -103,7 +103,7 @@ static const char
nfree = DATA_Take_Freelist(&local_freehead);
MASSERT(nfree == config.maxdone);
MASSERT(nfree == config.max_records);
MASSERT0(!VSTAILQ_EMPTY(&local_freehead),
"Local freelist empty after take");
......@@ -127,7 +127,7 @@ static const char
MASSERT0(VSTAILQ_EMPTY(&local_freehead),
"Local freelist non-empty after return");
MASSERT(global_nfree == DEF_MAXDONE);
MASSERT(global_nfree == DEF_MAX_RECORDS);
MASSERT0(!VSTAILQ_EMPTY(&freehead),
"Global free list empty after take");
......
......@@ -44,7 +44,7 @@
#define NCON 10
#define TABLE_SIZE (DEF_MAXDONE)
#define TABLE_SIZE (DEF_MAX_RECORDS)
int run;
......@@ -81,7 +81,7 @@ static void
srand48(time(NULL));
unsigned xid = (unsigned int) lrand48();
for (int i = 0; i < config.maxdone; i++) {
for (int i = 0; i < config.max_records; i++) {
entries[i].xid = xid;
debug_print("Producer: enqueue %d (xid = %u)\n", ++enqs, xid);
SPMCQ_Enq(&entries[i]);
......@@ -170,7 +170,7 @@ static char
return(errmsg);
}
config.maxdone = DEF_MAXDONE;
config.max_records = DEF_MAX_RECORDS;
err = SPMCQ_Init();
sprintf(errmsg, "SPMCQ_Init: %s", strerror(err));
mu_assert(errmsg, err == 0);
......
......@@ -100,7 +100,7 @@ static char
printf("... testing worker initialization\n");
config.maxdone = DEF_MAXDONE;
config.max_records = DEF_MAX_RECORDS;
config.maxdata = DEF_MAXDATA;
config.maxkeylen = DEF_MAXKEYLEN;
config.nworkers = NWORKERS;
......@@ -142,7 +142,7 @@ static const char
VMASSERT(wrk_running == NWORKERS,
"%d of %d worker threads running", wrk_running, NWORKERS);
for (int i = 0; i < config.maxdone; i++) {
for (int i = 0; i < config.max_records; i++) {
entry = &entrytbl[i];
MCHECK_OBJ_NOTNULL(entry, DATA_MAGIC);
entry->xid = xid;
......@@ -162,7 +162,7 @@ static const char
* Verify DATA_Reset() by checking that all data entry fields are in
* empty states after worker threads are shut down.
*/
for (int i = 0; i < config.maxdone; i++) {
for (int i = 0; i < config.max_records; i++) {
entry = &entrytbl[i];
MCHECK_OBJ_NOTNULL(entry, DATA_MAGIC);
MASSERT(!OCCUPIED(entry));
......
......@@ -5,7 +5,7 @@ varnish.bindump =
syslog.facility = LOCAL5
monitor.interval = 30
monitor.workers = true
maxdone = 10000
max.records = 10000
maxdata = 8192
maxkeylen = 126
qlen.goal = 4990
......
......@@ -5,7 +5,7 @@ varnish.bindump =
syslog.facility = LOCAL5
monitor.interval = 300
monitor.workers = false
maxdone = 10001
max.records = 10001
maxdata = 1024
maxkeylen = 124
qlen.goal = 4991
......
......@@ -5,7 +5,7 @@ varnish.bindump =
syslog.facility = LOCAL5
monitor.interval = 10000000
monitor.workers = true
maxdone = 10001
max.records = 10001
maxdata = 1024
maxkeylen = 124
qlen.goal = 4991
......
......@@ -5,7 +5,7 @@ varnish.bindump =
syslog.facility = LOCAL5
monitor.interval = 10000000
monitor.workers = true
maxdone = 10001
max.records = 10001
maxdata = 1024
maxkeylen = 124
qlen.goal = 4991
......
......@@ -176,8 +176,8 @@ struct config {
unsigned monitor_interval;
unsigned monitor_workers;
unsigned maxdone; /* max number of records in *_DONE state */
#define DEF_MAXDONE 1024
unsigned max_records; /* max number of buffered records */
#define DEF_MAX_RECORDS 1024
unsigned maxdata; /* size of char data buffer */
#define DEF_MAXDATA 1024
......
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