Electroneum
stats.h File Reference
#include "util/timehist.h"
#include "libunbound/unbound.h"
Include dependency graph for stats.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void server_stats_init (struct ub_server_stats *stats, struct config_file *cfg)
 
void server_stats_querymiss (struct ub_server_stats *stats, struct worker *worker)
 
void server_stats_prefetch (struct ub_server_stats *stats, struct worker *worker)
 
void server_stats_log (struct ub_server_stats *stats, struct worker *worker, int threadnum)
 
void server_stats_obtain (struct worker *worker, struct worker *who, struct ub_stats_info *s, int reset)
 
void server_stats_compile (struct worker *worker, struct ub_stats_info *s, int reset)
 
void server_stats_reply (struct worker *worker, int reset)
 
void server_stats_add (struct ub_stats_info *total, struct ub_stats_info *a)
 
void server_stats_insquery (struct ub_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 ub_server_stats *stats, struct sldns_buffer *buf)
 

Detailed Description

This file describes the data structure used to collect runtime performance numbers. These 'statistics' may be of interest to the operator.

Definition in file stats.h.

Function Documentation

◆ server_stats_add()

void server_stats_add ( struct ub_stats_info total,
struct ub_stats_info a 
)

Addup stat blocks.

Parameters
totalsum of the two entries.
ato add to it.

◆ server_stats_compile()

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

Compile stats into structure for this thread worker. Also clears the statistics counters (if that is set by config file).

Parameters
workerthe worker to compile stats for, also the executing worker.
sstats block.
resetif true, depending on config stats are reset. if false, statistics are not reset.

◆ server_stats_init()

void server_stats_init ( struct ub_server_stats stats,
struct config_file cfg 
)

Initialize server stats to 0.

Parameters
statswhat to init (this is alloced by the caller).
cfgwith extended statistics option.

◆ server_stats_insquery()

void server_stats_insquery ( struct ub_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

Parameters
statsthe stats
ccommpoint with type and buffer.
qtypequery type
qclassquery class
ednsedns record
repinforeply info with remote address

◆ server_stats_insrcode()

void server_stats_insrcode ( struct ub_server_stats stats,
struct sldns_buffer buf 
)

Add rcode for this query.

Parameters
statsthe stats
bufbuffer with rcode. If buffer is length0: not counted.

◆ server_stats_log()

void server_stats_log ( struct ub_server_stats stats,
struct worker worker,
int  threadnum 
)

display the stats to the log

◆ server_stats_obtain()

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

Obtain the stats info for a given thread. Uses pipe to communicate.

Parameters
workerthe worker that is executing (the first worker).
whoon who to get the statistics info.
sthe stats block to fill in.
resetif stats can be reset.

◆ server_stats_prefetch()

void server_stats_prefetch ( struct ub_server_stats stats,
struct worker worker 
)

add query if was cached and also resulted in a prefetch

◆ server_stats_querymiss()

void server_stats_querymiss ( struct ub_server_stats stats,
struct worker worker 
)

add query if it missed the cache

◆ server_stats_reply()

void server_stats_reply ( struct worker worker,
int  reset 
)

Send stats over comm tube in reply to query cmd

Parameters
workerthis worker.
resetif true, depending on config stats are reset. if false, statistics are not reset.