Commit 0686ce66 authored by Marek Vavruša's avatar Marek Vavruša

modules/stats: updated doc on statistics

parent 7b197ffc
......@@ -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``
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment