Skip to main content


msys.counter.add — Add to the current value of the specified counter


msys.counter.add(object_or_path, delta);

object_or_path: mixed
delta: number


The first argument is either a path to a counter (for example, /sites/site_name/errors) or a counter object that was returned by If a string is provided containing the path to a counter that does not exist, the counter is created with STRICT semantics. The second argument is atomically added to the current value of the counter.

Enable this function with the statement require('msys.counter');. For a code example, see “ example”.

You can also use the counter console command to display and manipulate counters.

See Also

Was this page helpful?