View Source exometer_info (exometer_core v2.0.0)

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.

Summary

Functions

Pretty-print a record, or list containing records.

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.

Performs a lookup by name of entry and pretty-prints the result.

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.

Return the operational status of the given exometer entry.

Types

-type pp() :: {atom(), [{atom(), any()}]}.

Functions

-spec pp(tuple() | list()) -> pp() | [pp() | any()].

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.
-spec pp_find(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.
-spec pp_lookup(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.
-spec pp_select(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 ['$_'].
-spec status(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).