]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/stats: updated doc on statistics
authorMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 21 May 2015 17:55:54 +0000 (19:55 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Mon, 25 May 2015 11:49:17 +0000 (13:49 +0200)
modules/stats/README.rst

index 7fb2d1b066cf2fc6d55f6158765bb350cf1254db..87b91c1d49538f80bb57533cca49427416826df7 100644 (file)
@@ -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``