void server_stats_log(struct server_stats* stats, int threadnum)
{
- log_info("server stats for thread %d: %u queries, %u from cache",
+ log_info("server stats for thread %d: %u queries, "
+ "%u answers from cache, %u recursions",
threadnum, (unsigned)stats->num_queries,
(unsigned)(stats->num_queries -
- stats->num_queries_missed_cache));
+ stats->num_queries_missed_cache),
+ (unsigned)stats->num_queries_missed_cache);
log_info("server stats for thread %d: requestlist max %u avg %g "
"exceeded %u", threadnum, (unsigned)stats->max_query_list_size,
stats->num_queries_missed_cache?
void worker_stat_timer_cb(void* arg)
{
struct worker* worker = (struct worker*)arg;
- mesh_stats(worker->env.mesh, "mesh has");
server_stats_log(&worker->stats, worker->thread_num);
+ mesh_stats(worker->env.mesh, "mesh has");
worker_mem_report(worker, NULL);
server_stats_init(&worker->stats);
mesh_stats_clear(worker->env.mesh);
if(!worker)
return;
if(worker->env.mesh && verbosity >= VERB_OPS) {
- mesh_stats(worker->env.mesh, "mesh has");
server_stats_log(&worker->stats, worker->thread_num);
+ mesh_stats(worker->env.mesh, "mesh has");
worker_mem_report(worker, NULL);
}
mesh_delete(worker->env.mesh);
11 February 2008: Wouter
- changed library to use ub_ instead of ub_val_ as prefix.
+ - statistics output text nice.
8 February 2008: Wouter
- test program for multiple queries over a TCP channel.
void
mesh_stats(struct mesh_area* mesh, const char* str)
{
- log_info("%s %u states (%u with reply, %u detached), "
- "%u waiting replies", str, (unsigned)mesh->all.count,
+ verbose(VERB_DETAIL, "%s %u recursion states (%u with reply, "
+ "%u detached), %u waiting replies, %u recursion replies "
+ "sent", str, (unsigned)mesh->all.count,
(unsigned)mesh->num_reply_states,
(unsigned)mesh->num_detached_states,
- (unsigned)mesh->num_reply_addrs);
+ (unsigned)mesh->num_reply_addrs,
+ (unsigned)mesh->replies_sent);
if(mesh->replies_sent > 0) {
struct timeval avg;
timeval_divide(&avg, &mesh->replies_sum_wait,
mesh->replies_sent);
- log_info("sent %u replies, with average wait "
- "of %d.%6.6d sec", (unsigned)mesh->replies_sent,
- (int)avg.tv_sec, (int)avg.tv_usec);
- log_info("histogram of reply wait times");
- timehist_log(mesh->histogram);
+ log_info("average recursion processing time "
+ "%d.%6.6d sec", (int)avg.tv_sec, (int)avg.tv_usec);
+ log_info("histogram of recursion processing times");
+ timehist_log(mesh->histogram, "recursions");
}
}
#endif
}
-void timehist_log(struct timehist* hist)
+void timehist_log(struct timehist* hist, const char* name)
{
#ifndef S_SPLINT_S
size_t i;
timehist_quartile(hist, 0.50),
timehist_quartile(hist, 0.75));
/* 0000.000000 0000.000000 0 */
- log_info("lower(secs) upper(secs) replycount");
+ log_info("lower(secs) upper(secs) %s", name);
for(i=0; i<hist->num; i++) {
if(hist->buckets[i].count != 0) {
log_info("%4d.%6.6d %4d.%6.6d %u",
/**
* Log histogram, print it to the logfile.
* @param hist: histogram
+ * @param name: the name of the value column
*/
-void timehist_log(struct timehist* hist);
+void timehist_log(struct timehist* hist, const char* name);
#endif /* UTIL_TIMEHIST_H */