Custom Metrics
=====================================
-You can define at configuration time your own metrics that can be updated using lua.
+You can define at configuration time your own metrics that can be updated using Lua.
The first step is to declare a new metric using :func:`declareMetric`.
.. function:: declareMetric(name, type) -> bool
- .. versionadded:: 1.x
+ .. versionadded:: 1.8.0
Return true if declaration was successful
- :param str name: The name of the metric, lowercase alnum characters only
+ :param str name: The name of the metric, lowercase alphanumerical characters and dashes (-) only
:param str type: The desired type in ``gauge`` or ``counter``
.. function:: incMetric(name) -> int
- .. versionadded:: 1.x
+ .. versionadded:: 1.8.0
Increment counter by one, will issue an error if the metric is not declared or not a ``counter``
Return the new value
.. function:: decMetric(name) -> int
- .. versionadded:: 1.x
+ .. versionadded:: 1.8.0
Decrement counter by one, will issue an error if the metric is not declared or not a ``counter``
Return the new value
.. function:: getMetric(name) -> double
- .. versionadded:: 1.x
+ .. versionadded:: 1.8.0
Get metric value
.. function:: setMetric(name, value) -> double
- .. versionadded:: 1.x
+ .. versionadded:: 1.8.0
- Decrement counter by one, will issue an error if the metric is not declared or not a ``counter``
+ Set the new value, will issue an error if the metric is not declared or not a ``gauge``
Return the new value
:param str name: The name of the metric
-
-
-