Accessor function for exometer data structures.
This module uses the exprecs transform (see exprecs) to generate accessor functions for exometer data structures.
Note that the value
attribute in exometer_entry{}
records may not
represent the true value of the metric, since exometer entries often
have structured values, or are represented as CRDTs for update efficiency.
pp() = {atom(), [{atom(), any()}]}
pp/1 | Pretty-print a record, or list containing records. |
pp_find/1 | Performs exometer:find_entries(Path) & returns pretty-printed result.
|
pp_lookup/1 | Performs a lookup by name of entry and pretty-prints the result. |
pp_select/1 | Performs exometer:select(Pattern) & returns pretty-printed result.
|
status/1 | Return the operational status of the given exometer entry. |
Pretty-print a record, or list containing records.
This function pretty-prints a record as {RecordName, [{Attr,Value}]}
,
or, if the input is a list, recognizes records and pretty-prints them,
leaving other data structures unchanged.
pp_find(Path::list()) -> [pp()]
Performs `exometer:find_entries(Path) & returns pretty-printed result.
This function calls exometer:find_entries(Path)
, retrieves the entry
for each matching metric, and calls pp(Entry)
for each entry.
pp_lookup(Name::exometer:name()) -> pp() | undefined
Performs a lookup by name of entry and pretty-prints the result.
This function returns undefined
if the entry cannot be found.
pp_select(Pat::ets:match_spec()) -> [pp()]
Performs `exometer:select(Pattern) & returns pretty-printed result.
This function calls exometer:select(Pattern)
, retrieves the entry
for each matching metric, and calls pp(Entry)
for each entry.
Note that the match body of the select pattern must produce the full
{Name, Type, Status}
object, e.g. by specifying ['$_']
.
status(Exometer_entry::exometer:entry()) -> enabled | disabled
Return the operational status of the given exometer entry.
The status
attribute is overloaded in the #exometer_entry{}
record.
This function extracts the correct status (enabled | disabled
).