From: Vladimír Čunát Date: Thu, 4 Feb 2021 09:37:42 +0000 (+0100) Subject: modules/stats: fix README mistake in .set() X-Git-Tag: v5.3.0~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3bc56ecd760d9fbd3fe338a02164603ca6f405c;p=thirdparty%2Fknot-resolver.git modules/stats: fix README mistake in .set() Reported on: https://gitter.im/CZ-NIC/knot-resolver?at=601ae90e9fa6765ef8f6b408 --- diff --git a/modules/stats/README.rst b/modules/stats/README.rst index 1da310f10..27992aa4f 100644 --- a/modules/stats/README.rst +++ b/modules/stats/README.rst @@ -173,13 +173,19 @@ Module reference Return nominal value of given metric. -.. function:: stats.set(key, val) - - :param string key: i.e. ``"answer.total"`` - :param number val: i.e. ``5`` +.. function:: stats.set('key val') Set nominal value of given metric. +Example: + +.. code-block:: lua + + stats.set('answer.total 5') + -- or syntactic sugar + stats['answer.total'] = 5 + + .. function:: stats.list([prefix]) :param string prefix: optional metric prefix, i.e. ``"answer"`` shows only metrics beginning with "answer"