odyssey: add clients_processed stat info per worker

This commit is contained in:
Dmitry Simonenko 2018-11-19 18:32:05 +03:00
parent c61c1e81f7
commit 941449dfc1
3 changed files with 10 additions and 2 deletions

View File

@ -50,6 +50,8 @@ od_worker(void *arg)
break;
}
client->coroutine_id = coroutine_id;
worker->clients_processed++;
break;
}
case OD_MSTAT:
@ -68,14 +70,15 @@ od_worker(void *arg)
&msg_cache_size);
od_log(&instance->logger, "stats", NULL, NULL,
"worker[%d]: msg (%" PRIu64 " allocated, %" PRIu64 " cached, %" PRIu64 " freed, %" PRIu64 " cache_size), "
"coroutines (%" PRIu64 " active, %"PRIu64 " cached)",
"coroutines (%" PRIu64 " active, %"PRIu64 " cached), clients_processed: %" PRIu64,
worker->id,
msg_allocated,
msg_cache_count,
msg_cache_gc_count,
msg_cache_size,
count_coroutine,
count_coroutine_cache);
count_coroutine_cache,
worker->clients_processed);
break;
}
default:
@ -95,6 +98,7 @@ od_worker_init(od_worker_t *worker, od_global_t *global, int id)
worker->machine = -1;
worker->id = id;
worker->global = global;
worker->clients_processed = 0;
}
int

View File

@ -14,6 +14,7 @@ struct od_worker
int64_t machine;
int id;
machine_channel_t *task_channel;
uint64_t clients_processed;
od_global_t *global;
};

View File

@ -53,6 +53,9 @@ od_worker_pool_feed(od_worker_pool_t *pool, machine_msg_t *msg)
}
pool->round_robin++;
printf(">>>> %d\n", next);
fflush(stdout);
od_worker_t *worker;
worker = &pool->pool[next];
machine_channel_write(worker->task_channel, msg);