From e3bc56ecd760d9fbd3fe338a02164603ca6f405c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 4 Feb 2021 10:37:42 +0100 Subject: [PATCH] modules/stats: fix README mistake in .set() Reported on: https://gitter.im/CZ-NIC/knot-resolver?at=601ae90e9fa6765ef8f6b408 --- modules/stats/README.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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" -- 2.47.2