From: Marek VavruĊĦa Date: Thu, 21 May 2015 17:55:54 +0000 (+0200) Subject: modules/stats: updated doc on statistics X-Git-Tag: v1.0.0-beta1~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0686ce66812aa409af102ef798c997f4feb8051c;p=thirdparty%2Fknot-resolver.git modules/stats: updated doc on statistics --- diff --git a/modules/stats/README.rst b/modules/stats/README.rst index 7fb2d1b06..87b91c1d4 100644 --- a/modules/stats/README.rst +++ b/modules/stats/README.rst @@ -4,22 +4,43 @@ Statistics collector -------------------- This modules gathers various counters from the query resolution and server internals, -and offers them as a key-value storage. +and offers them as a key-value storage. Any module may update the metrics or simply hook +in new ones. Properties ^^^^^^^^^^ .. function:: stats.get(key) - :param string key: i.e. ``"queries"`` + :param string key: i.e. ``"answer.total"`` :return: ``number`` -Return nominal value of given key. +Return nominal value of given metric. .. function:: stats.set(key, val) - :param string key: i.e. ``"queries"`` + :param string key: i.e. ``"answer.total"`` :param number val: i.e. ``5`` -Set nominal value of given key. +Set nominal value of given metric. +.. function:: stats.list([prefix]) + + :param string prefix: optional metric prefix, i.e. ``"answer"`` shows only metrics beginning with "answer" + +Outputs collected metrics as a JSON dictionary. + +Built-in statistics +^^^^^^^^^^^^^^^^^^^ + +* ``answer.total`` +* ``answer.cached`` +* ``answer.unresolved`` +* ``answer.noerror`` +* ``answer.nxdomain`` +* ``answer.servfail`` +* ``query.concurrent`` +* ``query.edns`` +* ``query.dnssec`` +* ``iterator.udp`` +* ``iterator.tcp``