stats.h File Reference

#include <dns/types.h>

Go to the source code of this file.

Defines

#define DNS_STATS_H   1
#define DNS_STATS_NCOUNTERS   8
 (Obsoleted)
#define DNS_RDATASTATSTYPE_ATTR_OTHERTYPE   0x0001
 Attributes for statistics counters of RRset and Rdatatype types.
#define DNS_RDATASTATSTYPE_ATTR_NXRRSET   0x0002
#define DNS_RDATASTATSTYPE_ATTR_NXDOMAIN   0x0004
#define DNS_RDATASTATSTYPE_ATTR_STALE   0x0008
 Conversion macros among dns_rdatatype_t, attributes and isc_statscounter_t.
#define DNS_RDATASTATSTYPE_BASE(type)   ((dns_rdatatype_t)((type) & 0xFFFF))
#define DNS_RDATASTATSTYPE_ATTR(type)   ((type) >> 16)
#define DNS_RDATASTATSTYPE_VALUE(b, a)   (((a) << 16) | (b))
 Types of dump callbacks.

Typedefs

typedef void(* dns_generalstats_dumper_t )(isc_statscounter_t, isc_uint64_t, void *)
typedef void(* dns_rdatatypestats_dumper_t )(dns_rdatastatstype_t, isc_uint64_t, void *)
typedef void(* dns_opcodestats_dumper_t )(dns_opcode_t, isc_uint64_t, void *)

Enumerations

enum  {
  dns_resstatscounter_queryv4 = 0, dns_resstatscounter_queryv6 = 1, dns_resstatscounter_responsev4 = 2, dns_resstatscounter_responsev6 = 3,
  dns_resstatscounter_nxdomain = 4, dns_resstatscounter_servfail = 5, dns_resstatscounter_formerr = 6, dns_resstatscounter_othererror = 7,
  dns_resstatscounter_edns0fail = 8, dns_resstatscounter_mismatch = 9, dns_resstatscounter_truncated = 10, dns_resstatscounter_lame = 11,
  dns_resstatscounter_retry = 12, dns_resstatscounter_gluefetchv4 = 13, dns_resstatscounter_gluefetchv6 = 14, dns_resstatscounter_gluefetchv4fail = 15,
  dns_resstatscounter_gluefetchv6fail = 16, dns_resstatscounter_val = 17, dns_resstatscounter_valsuccess = 18, dns_resstatscounter_valnegsuccess = 19,
  dns_resstatscounter_valfail = 20, dns_resstatscounter_dispabort = 21, dns_resstatscounter_dispsockfail = 22, dns_resstatscounter_querytimeout = 23,
  dns_resstatscounter_queryrtt0 = 24, dns_resstatscounter_queryrtt1 = 25, dns_resstatscounter_queryrtt2 = 26, dns_resstatscounter_queryrtt3 = 27,
  dns_resstatscounter_queryrtt4 = 28, dns_resstatscounter_queryrtt5 = 29, dns_resstatscounter_nfetch = 30, dns_resstatscounter_disprequdp = 31,
  dns_resstatscounter_dispreqtcp = 32, dns_resstatscounter_buckets = 33, dns_resstatscounter_refused = 34, dns_resstatscounter_badvers = 35,
  dns_resstatscounter_max = 36, dns_dnssecstats_asis = 0, dns_dnssecstats_downcase = 1, dns_dnssecstats_wildcard = 2,
  dns_dnssecstats_fail = 3, dns_dnssecstats_max = 4, dns_zonestatscounter_notifyoutv4 = 0, dns_zonestatscounter_notifyoutv6 = 1,
  dns_zonestatscounter_notifyinv4 = 2, dns_zonestatscounter_notifyinv6 = 3, dns_zonestatscounter_notifyrej = 4, dns_zonestatscounter_soaoutv4 = 5,
  dns_zonestatscounter_soaoutv6 = 6, dns_zonestatscounter_axfrreqv4 = 7, dns_zonestatscounter_axfrreqv6 = 8, dns_zonestatscounter_ixfrreqv4 = 9,
  dns_zonestatscounter_ixfrreqv6 = 10, dns_zonestatscounter_xfrsuccess = 11, dns_zonestatscounter_xfrfail = 12, dns_zonestatscounter_max = 13,
  dns_adbstats_nentries = 0, dns_adbstats_entriescnt = 1, dns_adbstats_nnames = 2, dns_adbstats_namescnt = 3,
  dns_adbstats_max = 4, dns_cachestatscounter_hits = 1, dns_cachestatscounter_misses = 2, dns_cachestatscounter_queryhits = 3,
  dns_cachestatscounter_querymisses = 4, dns_cachestatscounter_deletelru = 5, dns_cachestatscounter_deletettl = 6, dns_cachestatscounter_max = 7,
  dns_statscounter_success = 0, dns_statscounter_referral = 1, dns_statscounter_nxrrset = 2, dns_statscounter_nxdomain = 3,
  dns_statscounter_recursion = 4, dns_statscounter_failure = 5, dns_statscounter_duplicate = 6, dns_statscounter_dropped = 7
}
 Statistics counters. Used as isc_statscounter_t values. More...

Functions

ISC_LANG_BEGINDECLS isc_result_t dns_generalstats_create (isc_mem_t *mctx, dns_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. This function is obsolete. A more general function, isc_stats_create(), should be used.
isc_result_t dns_rdatatypestats_create (isc_mem_t *mctx, dns_stats_t **statsp)
 Create a statistics counter structure per rdatatype.
isc_result_t dns_rdatasetstats_create (isc_mem_t *mctx, dns_stats_t **statsp)
 Create a statistics counter structure per RRset.
isc_result_t dns_opcodestats_create (isc_mem_t *mctx, dns_stats_t **statsp)
 Create a statistics counter structure per opcode.
void dns_stats_attach (dns_stats_t *stats, dns_stats_t **statsp)
 Attach to a statistics set.
void dns_stats_detach (dns_stats_t **statsp)
 Detaches from the statistics set.
void dns_generalstats_increment (dns_stats_t *stats, isc_statscounter_t counter)
 Increment the counter-th counter of stats. This function is obsolete. A more general function, isc_stats_increment(), should be used.
void dns_rdatatypestats_increment (dns_stats_t *stats, dns_rdatatype_t type)
 Increment the statistics counter for 'type'.
void dns_rdatasetstats_increment (dns_stats_t *stats, dns_rdatastatstype_t rrsettype)
 Increment the statistics counter for 'rrsettype'.
void dns_rdatasetstats_decrement (dns_stats_t *stats, dns_rdatastatstype_t rrsettype)
 Decrement the statistics counter for 'rrsettype'.
void dns_opcodestats_increment (dns_stats_t *stats, dns_opcode_t code)
 Increment the statistics counter for 'code'.
void dns_generalstats_dump (dns_stats_t *stats, dns_generalstats_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 dns_rdatatypestats_dump (dns_stats_t *stats, dns_rdatatypestats_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 the corresponding type in the form of dns_rdatastatstype_t, the current counter 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 dns_rdatasetstats_dump (dns_stats_t *stats, dns_rdatatypestats_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 the corresponding type in the form of dns_rdatastatstype_t, the current counter 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 dns_opcodestats_dump (dns_stats_t *stats, dns_opcodestats_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 the corresponding opcode, the current counter 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.
isc_result_t dns_stats_alloccounters (isc_mem_t *mctx, isc_uint64_t **ctrp)
 Allocate an array of query statistics counters from the memory context 'mctx'.
void dns_stats_freecounters (isc_mem_t *mctx, isc_uint64_t **ctrp)
 Free an array of query statistics counters allocated from the memory context 'mctx'.

Variables

LIBDNS_EXTERNAL_DATA const char * dns_statscounter_names []


Detailed Description

Definition in file stats.h.


Define Documentation

#define DNS_STATS_H   1

Definition at line 21 of file stats.h.

#define DNS_STATS_NCOUNTERS   8

(Obsoleted)

Definition at line 146 of file stats.h.

Referenced by dns_stats_alloccounters(), and dns_stats_freecounters().

#define DNS_RDATASTATSTYPE_ATTR_OTHERTYPE   0x0001

Attributes for statistics counters of RRset and Rdatatype types.

_OTHERTYPE The rdata type is not explicitly supported and the corresponding counter is counted for other such types, too. When this attribute is set, the base type is of no use.

_NXRRSET RRset type counters only. Indicates the RRset is non existent.

_NXDOMAIN RRset type counters only. Indicates a non existent name. When this attribute is set, the base type is of no use.

_STALE RRset type counters only. This indicates a record that marked for removal.

Note: incrementing _STALE will decrement the corresponding non-stale counter.

Definition at line 183 of file stats.h.

Referenced by checkit1(), checkit2(), dump_rdentry(), rdatasetstats_dump(), and rdtypestat_dump().

#define DNS_RDATASTATSTYPE_ATTR_NXRRSET   0x0002

Definition at line 184 of file stats.h.

Referenced by checkit1(), checkit2(), rdataset_dumpcb(), rdatasetstats_dump(), set_typestats(), update_rdatasetstats(), and update_rrsetstats().

#define DNS_RDATASTATSTYPE_ATTR_NXDOMAIN   0x0004

Definition at line 185 of file stats.h.

Referenced by checkit1(), checkit2(), rdataset_dumpcb(), rdatasetstats_dump(), set_nxdomainstats(), update_rdatasetstats(), and update_rrsetstats().

#define DNS_RDATASTATSTYPE_ATTR_STALE   0x0008

Conversion macros among dns_rdatatype_t, attributes and isc_statscounter_t.

Definition at line 186 of file stats.h.

Referenced by checkit1(), checkit2(), rdataset_dumpcb(), rdatasetstats_dump(), set_nxdomainstats(), set_typestats(), and update_rdatasetstats().

#define DNS_RDATASTATSTYPE_BASE ( type   )     ((dns_rdatatype_t)((type) & 0xFFFF))

Definition at line 191 of file stats.h.

Referenced by checkit1(), checkit2(), rdatasetstats_dump(), rdtypestat_dump(), and update_rdatasetstats().

#define DNS_RDATASTATSTYPE_ATTR ( type   )     ((type) >> 16)

Definition at line 192 of file stats.h.

Referenced by checkit1(), checkit2(), rdatasetstats_dump(), rdtypestat_dump(), and update_rdatasetstats().

#define DNS_RDATASTATSTYPE_VALUE ( b,
 )     (((a) << 16) | (b))

Types of dump callbacks.

Definition at line 193 of file stats.h.

Referenced by dump_rdentry(), set_nxdomainstats(), set_typestats(), and update_rrsetstats().


Typedef Documentation

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

Definition at line 200 of file stats.h.

typedef void(* dns_rdatatypestats_dumper_t)(dns_rdatastatstype_t, isc_uint64_t, void *)

Definition at line 202 of file stats.h.

typedef void(* dns_opcodestats_dumper_t)(dns_opcode_t, isc_uint64_t, void *)

Definition at line 204 of file stats.h.


Enumeration Type Documentation

anonymous enum

Statistics counters. Used as isc_statscounter_t values.

Enumerator:
dns_resstatscounter_queryv4  Resolver statistics counters.
dns_resstatscounter_queryv6 
dns_resstatscounter_responsev4 
dns_resstatscounter_responsev6 
dns_resstatscounter_nxdomain 
dns_resstatscounter_servfail 
dns_resstatscounter_formerr 
dns_resstatscounter_othererror 
dns_resstatscounter_edns0fail 
dns_resstatscounter_mismatch 
dns_resstatscounter_truncated 
dns_resstatscounter_lame 
dns_resstatscounter_retry 
dns_resstatscounter_gluefetchv4 
dns_resstatscounter_gluefetchv6 
dns_resstatscounter_gluefetchv4fail 
dns_resstatscounter_gluefetchv6fail 
dns_resstatscounter_val 
dns_resstatscounter_valsuccess 
dns_resstatscounter_valnegsuccess 
dns_resstatscounter_valfail 
dns_resstatscounter_dispabort 
dns_resstatscounter_dispsockfail 
dns_resstatscounter_querytimeout 
dns_resstatscounter_queryrtt0 
dns_resstatscounter_queryrtt1 
dns_resstatscounter_queryrtt2 
dns_resstatscounter_queryrtt3 
dns_resstatscounter_queryrtt4 
dns_resstatscounter_queryrtt5 
dns_resstatscounter_nfetch 
dns_resstatscounter_disprequdp 
dns_resstatscounter_dispreqtcp 
dns_resstatscounter_buckets 
dns_resstatscounter_refused 
dns_resstatscounter_badvers 
dns_resstatscounter_max 
dns_dnssecstats_asis 
dns_dnssecstats_downcase 
dns_dnssecstats_wildcard 
dns_dnssecstats_fail 
dns_dnssecstats_max 
dns_zonestatscounter_notifyoutv4  Zone statistics counters.
dns_zonestatscounter_notifyoutv6 
dns_zonestatscounter_notifyinv4 
dns_zonestatscounter_notifyinv6 
dns_zonestatscounter_notifyrej 
dns_zonestatscounter_soaoutv4 
dns_zonestatscounter_soaoutv6 
dns_zonestatscounter_axfrreqv4 
dns_zonestatscounter_axfrreqv6 
dns_zonestatscounter_ixfrreqv4 
dns_zonestatscounter_ixfrreqv6 
dns_zonestatscounter_xfrsuccess 
dns_zonestatscounter_xfrfail 
dns_zonestatscounter_max 
dns_adbstats_nentries 
dns_adbstats_entriescnt 
dns_adbstats_nnames 
dns_adbstats_namescnt 
dns_adbstats_max 
dns_cachestatscounter_hits 
dns_cachestatscounter_misses 
dns_cachestatscounter_queryhits 
dns_cachestatscounter_querymisses 
dns_cachestatscounter_deletelru 
dns_cachestatscounter_deletettl 
dns_cachestatscounter_max 
dns_statscounter_success  Query statistics counters (obsolete).

Successful lookup

dns_statscounter_referral  Referral result.
dns_statscounter_nxrrset  NXRRSET result.
dns_statscounter_nxdomain  NXDOMAIN result.
dns_statscounter_recursion  Recursion was used.
dns_statscounter_failure  Some other failure.
dns_statscounter_duplicate  Duplicate query.
dns_statscounter_dropped  Duplicate query (dropped).

Definition at line 30 of file stats.h.


Function Documentation

ISC_LANG_BEGINDECLS isc_result_t dns_generalstats_create ( isc_mem_t mctx,
dns_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. This function is obsolete. A more general function, isc_stats_create(), should be used.

Requires:

Returns:

Definition at line 165 of file stats.c.

References create_stats(), dns_statstype_general, and REQUIRE.

isc_result_t dns_rdatatypestats_create ( isc_mem_t mctx,
dns_stats_t **  statsp 
)

Create a statistics counter structure per rdatatype.

Requires:

Returns:

Definition at line 172 of file stats.c.

References create_stats(), dns_statstype_rdtype, rdtypecounter_max, and REQUIRE.

Referenced by configure_view(), ns_server_create(), and ns_zone_configure().

isc_result_t dns_rdatasetstats_create ( isc_mem_t mctx,
dns_stats_t **  statsp 
)

Create a statistics counter structure per RRset.

Requires:

Returns:

Definition at line 180 of file stats.c.

References create_stats(), dns_statstype_rdataset, rdatasettypecounter_max, and REQUIRE.

Referenced by ATF_TC_BODY(), and dns_rbtdb_create().

isc_result_t dns_opcodestats_create ( isc_mem_t mctx,
dns_stats_t **  statsp 
)

Create a statistics counter structure per opcode.

Requires:

Returns:

Definition at line 188 of file stats.c.

References create_stats(), dns_statstype_opcode, and REQUIRE.

Referenced by ns_server_create().

void dns_stats_attach ( dns_stats_t stats,
dns_stats_t **  statsp 
)

Attach to a statistics set.

Requires:

Definition at line 92 of file stats.c.

References DNS_STATS_VALID, dns_stats::lock, LOCK, dns_stats::references, REQUIRE, and UNLOCK.

Referenced by dns_view_getresquerystats(), and dns_view_setresquerystats().

void dns_stats_detach ( dns_stats_t **  statsp  ) 

Detaches from the statistics set.

Requires:

Definition at line 104 of file stats.c.

References dns_stats::counters, DESTROYLOCK, DNS_STATS_VALID, isc_mem_putanddetach, isc_stats_detach(), dns_stats::lock, LOCK, dns_stats::mctx, dns_stats::references, REQUIRE, and UNLOCK.

Referenced by ATF_TC_BODY(), configure_view(), destroy(), dns_rbtdb_create(), free_rbtdb(), ns_server_destroy(), ns_zone_configure(), and zone_free().

void dns_generalstats_increment ( dns_stats_t stats,
isc_statscounter_t  counter 
)

Increment the counter-th counter of stats. This function is obsolete. A more general function, isc_stats_increment(), should be used.

Requires:

Definition at line 198 of file stats.c.

References dns_stats::counters, DNS_STATS_VALID, dns_statstype_general, isc_stats_increment(), REQUIRE, and dns_stats::type.

void dns_rdatatypestats_increment ( dns_stats_t stats,
dns_rdatatype_t  type 
)

Increment the statistics counter for 'type'.

Requires:

Definition at line 205 of file stats.c.

References counter, dns_stats::counters, DNS_STATS_VALID, dns_statstype_rdtype, isc_stats_increment(), rdtypecounter_dlv, rdtypecounter_others, REQUIRE, and dns_stats::type.

Referenced by fctx_query(), inc_stats(), and ns_query_start().

void dns_rdatasetstats_increment ( dns_stats_t stats,
dns_rdatastatstype_t  rrsettype 
)

Increment the statistics counter for 'rrsettype'.

Note: if 'rrsettype' has the _STALE attribute set the corresponding non-stale counter will be decremented.

Requires:

Definition at line 260 of file stats.c.

References DNS_STATS_VALID, dns_statstype_rdataset, ISC_TRUE, REQUIRE, dns_stats::type, and update_rdatasetstats().

Referenced by set_nxdomainstats(), set_typestats(), and update_rrsetstats().

void dns_rdatasetstats_decrement ( dns_stats_t stats,
dns_rdatastatstype_t  rrsettype 
)

Decrement the statistics counter for 'rrsettype'.

Requires:

Definition at line 269 of file stats.c.

References DNS_STATS_VALID, dns_statstype_rdataset, ISC_FALSE, REQUIRE, dns_stats::type, and update_rdatasetstats().

Referenced by update_rrsetstats().

void dns_opcodestats_increment ( dns_stats_t stats,
dns_opcode_t  code 
)

Increment the statistics counter for 'code'.

Requires:

Definition at line 278 of file stats.c.

References dns_stats::counters, DNS_STATS_VALID, dns_statstype_opcode, isc_stats_increment(), REQUIRE, and dns_stats::type.

Referenced by client_request().

void dns_generalstats_dump ( dns_stats_t stats,
dns_generalstats_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.

This function is obsolete. A more general function, isc_stats_dump(), should be used.

Requires:

Definition at line 288 of file stats.c.

References dns_stats::counters, DNS_STATS_VALID, dns_statstype_general, isc_stats_dump(), REQUIRE, and dns_stats::type.

void dns_rdatatypestats_dump ( dns_stats_t stats,
dns_rdatatypestats_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 the corresponding type in the form of dns_rdatastatstype_t, the current counter 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 325 of file stats.c.

References rdatadumparg::arg, arg, dns_stats::counters, DNS_STATS_VALID, dns_statstype_rdtype, rdatadumparg::fn, isc_stats_dump(), rdatatype_dumpcb(), REQUIRE, and dns_stats::type.

Referenced by ns_stats_dump().

void dns_rdatasetstats_dump ( dns_stats_t stats,
dns_rdatatypestats_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 the corresponding type in the form of dns_rdatastatstype_t, the current counter 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 372 of file stats.c.

References rdatadumparg::arg, arg, dns_stats::counters, DNS_STATS_VALID, dns_statstype_rdataset, rdatadumparg::fn, isc_stats_dump(), rdataset_dumpcb(), REQUIRE, and dns_stats::type.

Referenced by ATF_TC_BODY(), and ns_stats_dump().

void dns_opcodestats_dump ( dns_stats_t stats,
dns_opcodestats_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 the corresponding opcode, the current counter 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 393 of file stats.c.

References opcodedumparg::arg, arg, dns_stats::counters, DNS_STATS_VALID, dns_statstype_opcode, opcodedumparg::fn, isc_stats_dump(), opcode_dumpcb(), REQUIRE, and dns_stats::type.

Referenced by ns_stats_dump().

isc_result_t dns_stats_alloccounters ( isc_mem_t mctx,
isc_uint64_t **  ctrp 
)

Allocate an array of query statistics counters from the memory context 'mctx'.

This function is obsoleted. Use dns_xxxstats_create() instead.

Definition at line 421 of file stats.c.

References DNS_STATS_NCOUNTERS, isc_mem_get, ISC_R_NOMEMORY, and ISC_R_SUCCESS.

void dns_stats_freecounters ( isc_mem_t mctx,
isc_uint64_t **  ctrp 
)

Free an array of query statistics counters allocated from the memory context 'mctx'.

This function is obsoleted. Use dns_stats_destroy() instead.

Definition at line 434 of file stats.c.

References DNS_STATS_NCOUNTERS, and isc_mem_put.


Variable Documentation

LIBDNS_EXTERNAL_DATA const char* dns_statscounter_names[]

Definition at line 408 of file stats.c.


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