Public Member Functions | |
| __init__ (self, str name="") | |
| None | add_record (self, str name, *, Mapping[str, Any] values, Mapping[str, str|int]|None tags=None, float|None timestamp=None) |
| AbstractContextManager[None] | context_tags (self, _TagsType tags) |
Protected Attributes | |
| _name = name | |
| _service = MonService() | |
Client-side interface for adding monitoring records to the monitoring
service.
Parameters
----------
name : `str`
Client agent name, this is used for filtering of the records by the
service and is also passed to monitoring handler as ``agent_name``.
| None lsst.dax.apdb.monitor.MonAgent.add_record | ( | self, | |
| str | name, | ||
| * | , | ||
| Mapping[str, Any] | values, | ||
| Mapping[str, str | int] | None | tags = None, | ||
| float | None | timestamp = None ) |
Send one record to monitoring service.
Parameters
----------
name : `str`
Record name, arbitrary string.
values : `~collections.abc.Mapping` [`str`, `Any`]
Values associated with the record, usually never empty.
tags : `~collections.abc.Mapping` [`str`, `str` or `int`]
Tags associated with the record, may be empty.
timestamp : `str`
Time in seconds since UNIX epoch when record originated.
| AbstractContextManager[None] lsst.dax.apdb.monitor.MonAgent.context_tags | ( | self, | |
| _TagsType | tags ) |
Context manager that adds a set of tags to all records created
inside the context.
Parameters
----------
tags : `~collections.abc.Mapping` [`str`, `str` or `int`]
Tags associated with the records.
Notes
-----
All calls to `add_record` that happen inside the corresponding context
will add tags specified in this call. Tags specified in `add_record`
will override matching tag names that are passed to this method. On
exit from context a previous tag context is restored (which may be
empty).