Admin Guide
Configuration
Permissions
Package (synapse-metrics) defines the following permissions:
power-ups.metrics.user : Allows a user to issue queries to the Synapse Metrics service. ( default: false )
power-ups.metrics.stats.cortex : Allows a user to view statistics aggregated for all layers in the Cortex. ( default: false )
You may add rules to users/roles directly from storm:
> auth.user.addrule visi power-ups.metrics.user
Added rule power-ups.metrics.user to user visi.
or:
> auth.role.addrule ninjas power-ups.metrics.user
Added rule power-ups.metrics.user to role ninjas.
To allow a non-admin user to view statistics aggregated across all layers in the Cortex the following rule can be added. Users can always view statistics for their current view and write layer.
> auth.role.addrule ninjas power-ups.metrics.stats.cortex
Added rule power-ups.metrics.stats.cortex to role ninjas.
Exported Storm APIs
Synapse Metrics exports the metrics
module as a Storm API.
getTimeIval(time, back, noneok=$lib.true)
-----------------------------------------
Retrieve the current indexing status.
Returns:
dict: Status dictionary with a bool "success" key and offset information.
waitIndxOffs(offs, timeout=$lib.null)
-------------------------------------
Wait for the service to index edits at the given Nexus offset.
Args:
offs (int): The Nexus offset to wait for.
timeout (int or None): Optional timeout in seconds.
Returns:
bool: Whether the service reached the index or timed out.
waitIndxLive(timeout=$lib.null)
-------------------------------
Waits for the service to index edits at the current Nexus offset.
Args:
timeout (int or None): Optional timeout in seconds.
Returns:
bool: Whether the service reached the index or timed out.
aggStatsByTime(ival, scope="view", window=(60))
-----------------------------------------------
Retrieve statistics aggregated across the specified layers within the provided window.
Args:
ival (tuple): The timestamp interval to retrieve results for.
scope (str): One of "cortex" (all layers), "view" (current view), "layer" (current write layer).
window (int): The aggregation window time in seconds.
Yields:
tuple: Of (time, counts) where counts is a dictionary of count dictionaries.
Node Actions
Synapse Metrics does not currently provide an node actions in Optic.
Onload Events
Synapse Metrics does not use any onload
events.