Telepath API
- class synmods.metrics.service.MetricsApi
Bases:
StormSvc
,CellApi
- async aggStatsByTime(ival, lyrs, window=60)
Retrieve statistics aggregated across the specified layers within the provided window.
- Parameters:
ival (tuple) – The timestamp interval to retrieve results for.
lyrs (list) – List of Layer idens to retrieve data for.
window (int) – The aggregation window time in seconds.
- Yields:
tuple – Of (mesg type, data) where data is a dictionary of count dictionaries when mesg type is “data”.
- async editsByBuid(buid, lyrs, back=False, size=None)
Retrieve edits by node buid.
- Parameters:
buid (str) – The iden for the node.
lyrs (list) – List of Layer idens to retrieve data for.
back (bool) – If True, yield results in reverse order.
size (int or None) – Optional size limit for results.
- Yields:
dict – Edit with keys (offs, buid, form, layer, user, time) or “error” on failure.
- async editsByBuidBack(buid, lyrs, size=None)
Maintained for Optic compatibility with v1.x.x
- async editsByEdge(edge, lyrs, back=False, ival=None, size=None)
Retrieve edits by light edge name.
- Parameters:
edge (str) – The light edge name to retrieve results for.
lyrs (list) – List of Layer idens to retrieve data for.
back (bool) – If True, yield results in reverse order.
ival (tuple or None) – Optional timestamp tuple to restrict results.
size (int or None) – Optional size limit for results.
- Yields:
dict – Edit with keys (offs, buid, form, layer, user, time) or “error” on failure.
- async editsByProp(prop, lyrs, back=False, ival=None, size=None)
Retrieve edits by node property.
- Parameters:
prop (str) – The property to retrieve results for.
lyrs (list) – List of Layer idens to retrieve data for.
back (bool) – If True, yield results in reverse order.
ival (tuple or None) – Optional timestamp tuple to restrict results.
size (int or None) – Optional size limit for results.
- Yields:
dict – Edit with keys (offs, buid, form, layer, user, time) or “error” on failure.
- async editsByTag(tag, lyrs, back=False, ival=None, size=None)
Retrieve edits by tag.
- Parameters:
tag (str) – The tag to retrieve results for.
lyrs (list) – List of Layer idens to retrieve data for.
back (bool) – If True, yield results in reverse order.
ival (tuple or None) – Optional timestamp tuple to restrict results.
size (int or None) – Optional size limit for results.
- Yields:
dict – Edit with keys (offs, buid, form, layer, user, time) or “error” on failure.
- async editsByTagProp(prop, lyrs, back=False, ival=None, size=None)
Retrieve edits by tag property.
- Parameters:
prop (str) – The tag property to retrieve results for.
lyrs (list) – List of Layer idens to retrieve data for.
back (bool) – If True, yield results in reverse order.
ival (tuple or None) – Optional timestamp tuple to restrict results.
size (int or None) – Optional size limit for results.
- Yields:
dict – Edit with keys (offs, buid, form, layer, user, time) or “error” on failure.
- async editsByTime(ival, lyrs, back=False, size=None)
Retrieve edits by time interval.
- Parameters:
ival (tuple) – Timestamp tuple to retrieve data for.
lyrs (list) – List of Layer idens to retrieve data for.
back (bool) – If True, yield results in reverse order.
size (int or None) – Optional size limit for results.
- Yields:
dict – Edit with keys (offs, buid, form, layer, user, time) or “error” on failure.
- async editsByUser(user, lyrs, back=False, ival=None, size=None)
Retrieve edits by user.
- Parameters:
user (str) – The user iden.
lyrs (list) – List of Layer idens to retrieve data for.
back (bool) – If True, yield results in reverse order.
ival (tuple or None) – Optional timestamp tuple to restrict results.
size (int or None) – Optional size limit for results.
- Yields:
dict – Edit with keys (offs, buid, form, layer, user, time) or “error” on failure.
- async getLayersInfo()
Retrieve indexing details for all layers.
- Returns:
Dictionary with Layer idens as keys.
- Return type:
dict
- async getStatus()
Retrieve the current indexing status.
- Returns:
Status dictionary with a bool “success” key and offset information.
- Return type:
dict
- async reindex()
Delete all index data and restart indexing.
- async waitIndxLive(timeout=None)
Waits for the service to index edits at the current Nexus offset.
- Parameters:
timeout (int or None) – Optional timeout in seconds.
- Returns:
Whether the service reached the index or timed out.
- Return type:
bool
- async waitIndxOffs(offs, timeout=None)
Wait for the service to index edits at the given Nexus offset.
- Parameters:
offs (int) – The Nexus offset to wait for.
timeout (int or None) – Optional timeout in seconds.
- Returns:
Whether the service reached the index or timed out.
- Return type:
bool