mete v1.0.3 Mete View Source
[/miːt/] - Old English metan 'measure'
Basic measuring tool and telemetry writer using InfluxDB.
Usage
Add Mete to your application by adding {:mete, "~> 1.0.3"}
to your list of dependencies in mix.exs
:
def deps do
[
# ...
{:mete, "~> 1.0.3"}
]
end
Options
:host
- hostname of the server running the InfluxDB endpoint, defaults tolocalhost
:port
- port on which the InfluxDB server runs the respective input, defaults to8089
:protocol
- either:udp
, or:http
. Defaults to:udp
.:database
- has to be configured when using:http
:tags
- can be used to configure application-wide tags expects a Keywordlist of strings or atoms, defaults to[]
:batch
- InfluxDB supports batching measurements, can be deactivated withfalse
activated withtrue
or directly configure the byte-size of the payloads with an integer
ToDo
- Configurable handling of integer/float values.
- Configurable handling of timestamps
- Support for mfa's for measure.
- base default batch size on connection parameters
Link to this section Summary
Functions
Evaluates the given function, measures, and subsequently writes the elapsed real time.
Adds a meter point under the given atom to the process.
Reads the current process tags.
Alters the current process tags according the given keyword list.
Writes a measurement.
Calculates the delta for the process meter points and writes them under the measurement.
Link to this section Types
Link to this section Functions
measure(measurement, tags \\ [], fields \\ [], func)
View Sourcemeasure(measurement(), tags(), [Mete.Protocol.field()], (() -> any())) :: any()
Evaluates the given function, measures, and subsequently writes the elapsed real time.
iex> measure("query", fn -> "some query result" end)
"some query result"
Adds a meter point under the given atom to the process.
Reads the current process tags.
Alters the current process tags according the given keyword list.
The given keyword list will be merged into the existing tags,
tags set to nil
will remove that tag from the tag list.
write(measurement, tags \\ [], fields)
View Sourcewrite(measurement(), tags(), fields() | value()) :: :ok
Writes a measurement.
write("query", [exec: 20, queue: 33])
Calculates the delta for the process meter points and writes them under the measurement.