stats.c File Reference

This file describes the data structure used to collect runtime performance numbers. More...

#include "config.h"
#include "daemon/stats.h"
#include "daemon/worker.h"
#include "daemon/daemon.h"
#include "services/mesh.h"
#include "services/outside_network.h"
#include "util/config_file.h"
#include "util/tube.h"
#include "util/timehist.h"
#include "util/net_help.h"
#include "validator/validator.h"

Functions

static void timeval_add (struct timeval *d, const struct timeval *add)
 add timers and the values do not overflow or become negative
void server_stats_init (struct server_stats *stats, struct config_file *cfg)
 Initialize server stats to 0.
void server_stats_querymiss (struct server_stats *stats, struct worker *worker)
 add query if it missed the cache
void server_stats_log (struct server_stats *stats, struct worker *worker, int threadnum)
 display the stats to the log
static size_t get_rrset_bogus (struct worker *worker)
 get rrsets bogus number from validator
void server_stats_compile (struct worker *worker, struct stats_info *s, int reset)
 Compile stats into structure for this thread worker.
void server_stats_obtain (struct worker *worker, struct worker *who, struct stats_info *s, int reset)
 Obtain the stats info for a given thread.
void server_stats_reply (struct worker *worker, int reset)
 Send stats over comm tube in reply to query cmd.
void server_stats_add (struct stats_info *total, struct stats_info *a)
 Addup stat blocks.
void server_stats_insquery (struct server_stats *stats, struct comm_point *c, uint16_t qtype, uint16_t qclass, struct edns_data *edns, struct comm_reply *repinfo)
 Add stats for this query.
void server_stats_insrcode (struct server_stats *stats, ldns_buffer *buf)
 Add rcode for this query.


Detailed Description

This file describes the data structure used to collect runtime performance numbers.

These 'statistics' may be of interest to the operator.


Function Documentation

void server_stats_init ( struct server_stats stats,
struct config_file cfg 
)

Initialize server stats to 0.

Parameters:
stats,: what to init (this is alloced by the caller).
cfg,: with extended statistics option.

References server_stats::extended, and config_file::stat_extended.

Referenced by worker_init(), and worker_stats_clear().

void server_stats_compile ( struct worker worker,
struct stats_info s,
int  reset 
)

void server_stats_obtain ( struct worker worker,
struct worker who,
struct stats_info s,
int  reset 
)

Obtain the stats info for a given thread.

Uses pipe to communicate.

Parameters:
worker,: the worker that is executing (the first worker).
who,: on who to get the statistics info.
s,: the stats block to fill in.
reset,: if stats can be reset.

References worker::cmd, fatal_exit(), server_stats_compile(), tube_read_msg(), VERB_ALGO, verbose(), worker_cmd_stats, worker_cmd_stats_noreset, and worker_send_cmd().

Referenced by do_stats().

void server_stats_reply ( struct worker worker,
int  reset 
)

Send stats over comm tube in reply to query cmd.

Parameters:
worker,: this worker.
reset,: if true, depending on config stats are reset. if false, statistics are not reset.

References worker::cmd, worker::daemon, fatal_exit(), server_stats_compile(), tube_write_msg(), VERB_ALGO, verbose(), and daemon::workers.

Referenced by worker_handle_control_cmd().

void server_stats_add ( struct stats_info total,
struct stats_info a 
)

void server_stats_insquery ( struct server_stats stats,
struct comm_point c,
uint16_t  qtype,
uint16_t  qclass,
struct edns_data edns,
struct comm_reply repinfo 
)

void server_stats_insrcode ( struct server_stats stats,
ldns_buffer *  buf 
)

Add rcode for this query.

Parameters:
stats,: the stats
buf,: buffer with rcode. If buffer is length0: not counted.

References server_stats::ans_rcode, server_stats::ans_rcode_nodata, and server_stats::extended.

Referenced by answer_from_cache(), answer_norec_from_cache(), and worker_handle_request().


Generated on Tue Oct 13 06:45:49 2009 for unbound by  doxygen 1.5.9