stats.h File Reference

#include <isc/types.h>

Go to the source code of this file.

Defines

#define ISC_STATS_H   1
#define ISC_STATSDUMP_VERBOSE   0x00000001
 Flag(s) for isc_stats_dump().

Typedefs

typedef void(* isc_stats_dumper_t )(isc_statscounter_t, isc_uint64_t, void *)

Functions

isc_result_t isc_stats_create (isc_mem_t *mctx, isc_stats_t **statsp, int ncounters)
 Create a statistics counter structure of general type. It counts a general set of counters indexed by an ID between 0 and ncounters -1.
void isc_stats_attach (isc_stats_t *stats, isc_stats_t **statsp)
 Attach to a statistics set.
void isc_stats_detach (isc_stats_t **statsp)
 Detaches from the statistics set.
int isc_stats_ncounters (isc_stats_t *stats)
 Returns the number of counters contained in stats.
void isc_stats_increment (isc_stats_t *stats, isc_statscounter_t counter)
 Increment the counter-th counter of stats.
void isc_stats_decrement (isc_stats_t *stats, isc_statscounter_t counter)
 Decrement the counter-th counter of stats.
void isc_stats_dump (isc_stats_t *stats, isc_stats_dumper_t dump_fn, void *arg, unsigned int options)
 Dump the current statistics counters in a specified way. For each counter in stats, dump_fn is called with its current value and the given argument arg. By default counters that have a value of 0 is skipped; if options has the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped.
void isc_stats_set (isc_stats_t *stats, isc_uint64_t val, isc_statscounter_t counter)
 Set the given counter to the specfied value.


Detailed Description

Definition in file stats.h.


Define Documentation

#define ISC_STATS_H   1

Definition at line 20 of file stats.h.

#define ISC_STATSDUMP_VERBOSE   0x00000001

Flag(s) for isc_stats_dump().

< dump 0-value counters Dump callback type.

Definition at line 31 of file stats.h.

Referenced by dump_counters(), getcounters(), and isc_stats_dump().


Typedef Documentation

typedef void(* isc_stats_dumper_t)(isc_statscounter_t, isc_uint64_t, void *)

Definition at line 36 of file stats.h.


Function Documentation

isc_result_t isc_stats_create ( isc_mem_t mctx,
isc_stats_t **  statsp,
int  ncounters 
)

Create a statistics counter structure of general type. It counts a general set of counters indexed by an ID between 0 and ncounters -1.

Requires:

Returns:

Definition at line 291 of file stats.c.

References create_stats(), and REQUIRE.

Referenced by configure_view(), create_stats(), dns_adb_create(), dns_cache_create3(), ns_server_create(), ns_zone_configure(), and setquerystats().

void isc_stats_attach ( isc_stats_t stats,
isc_stats_t **  statsp 
)

Attach to a statistics set.

Requires:

Definition at line 150 of file stats.c.

References ISC_STATS_VALID, isc_stats::lock, LOCK, isc_stats::references, REQUIRE, and UNLOCK.

Referenced by dns_dispatchmgr_setstats(), dns_view_getadbstats(), dns_view_getresstats(), dns_view_setadbstats(), dns_view_setresstats(), and setcachestats().

void isc_stats_detach ( isc_stats_t **  statsp  ) 

Detaches from the statistics set.

Requires:

Definition at line 162 of file stats.c.

References isc_stats::copiedcounters, isc_stats::counters, DESTROYLOCK, isc_mem_put, isc_mem_putanddetach, isc_rwlock_destroy(), ISC_STATS_VALID, isc_stats::lock, LOCK, isc_stats::mctx, isc_stats::ncounters, isc_stats::references, REQUIRE, and UNLOCK.

Referenced by cache_free(), configure_view(), destroy(), destroy_mgr(), dns_cache_create3(), dns_stats_detach(), free_rbtdb(), ns_server_destroy(), ns_zone_configure(), setquerystats(), and zone_free().

int isc_stats_ncounters ( isc_stats_t stats  ) 

Returns the number of counters contained in stats.

Requires:

Definition at line 191 of file stats.c.

References ISC_STATS_VALID, isc_stats::ncounters, and REQUIRE.

void isc_stats_increment ( isc_stats_t stats,
isc_statscounter_t  counter 
)

Increment the counter-th counter of stats.

Requires:

Definition at line 298 of file stats.c.

References incrementcounter(), ISC_STATS_VALID, and REQUIRE.

Referenced by client_request(), client_send(), dns_cache_updatestats(), dns_generalstats_increment(), dns_opcodestats_increment(), dns_rdatatypestats_increment(), expire_header(), inc_adbstats(), inc_stat(), inc_stats(), ns_client_error(), process_opt(), query_prefetch(), query_recurse(), rpz_log_rewrite(), update_cachestats(), and update_rdatasetstats().

void isc_stats_decrement ( isc_stats_t stats,
isc_statscounter_t  counter 
)

Decrement the counter-th counter of stats.

Requires:

Definition at line 306 of file stats.c.

References decrementcounter(), ISC_STATS_VALID, and REQUIRE.

Referenced by dec_adbstats(), dec_stats(), ns_client_endrequest(), query_recurse(), and update_rdatasetstats().

void isc_stats_dump ( isc_stats_t stats,
isc_stats_dumper_t  dump_fn,
void *  arg,
unsigned int  options 
)

Dump the current statistics counters in a specified way. For each counter in stats, dump_fn is called with its current value and the given argument arg. By default counters that have a value of 0 is skipped; if options has the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped.

Requires:

Definition at line 314 of file stats.c.

References isc_stats::copiedcounters, copy_counters(), ISC_STATS_VALID, ISC_STATSDUMP_VERBOSE, isc_stats::ncounters, and REQUIRE.

Referenced by dns_generalstats_dump(), dns_opcodestats_dump(), dns_rdatasetstats_dump(), dns_rdatatypestats_dump(), dump_counters(), and getcounters().

void isc_stats_set ( isc_stats_t stats,
isc_uint64_t  val,
isc_statscounter_t  counter 
)

Set the given counter to the specfied value.

Requires:

Definition at line 332 of file stats.c.

References isc_stats::counters, isc_rwlock_lock(), isc_rwlock_unlock(), isc_rwlocktype_write, ISC_STATS_VALID, and REQUIRE.

Referenced by dns_resolver_create(), and set_adbstat().


Generated on Tue Apr 28 17:41:16 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha