]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/stats: fix README mistake in .set()
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 4 Feb 2021 09:37:42 +0000 (10:37 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 4 Feb 2021 09:38:39 +0000 (10:38 +0100)
Reported on:
https://gitter.im/CZ-NIC/knot-resolver?at=601ae90e9fa6765ef8f6b408

modules/stats/README.rst

index 1da310f109ae5d93d056db21eaba84e401aa822e..27992aa4ffe9c42bb9c5100d081c2105f094ae6c 100644 (file)
@@ -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"