exometer_statix v0.1.1 ExometerStatix.Client
Summary
Functions
Opens the connection to the StatsD-compatible server
Decrements the StatsD counter identified by key
by the given value
Writes to the StatsD gauge identified by key
Writes value
to the histogram identified by key
Increments the StatsD counter identified by key
by the given value
Measures the execution time of the given function
and writes that to the
StatsD timing identified by key
Writes the given value
to the StatsD set identified by key
Writes the given value
to the StatsD timing identified by key
Functions
Opens the connection to the StatsD-compatible server.
The configuration is read from the configuration for the :statix
application
(both globally and per connection).
Callback implementation for Statix.connect/0
.
Decrements the StatsD counter identified by key
by the given value
.
Works same as c:increment/3
but subtracts value
instead of adding it. For
this reason value
should be zero or negative.
Examples
iex> MyApp.Statix.decrement("open_connections", 1, [])
:ok
Callback implementation for Statix.decrement/3
.
Writes to the StatsD gauge identified by key
.
Examples
iex> MyApp.Statix.gauge("cpu_usage", 0.83, [])
:ok
Callback implementation for Statix.gauge/3
.
Writes value
to the histogram identified by key
.
Not all StatsD-compatible servers support histograms. An example of a such server statsite.
Examples
iex> MyApp.Statix.histogram("online_users", 123, [])
:ok
Callback implementation for Statix.histogram/3
.
Increments the StatsD counter identified by key
by the given value
.
value
is supposed to be zero or positive and c:decrement/3
should be
used for negative values.
Examples
iex> MyApp.Statix.increment("hits", 1, [])
:ok
Callback implementation for Statix.increment/3
.
Measures the execution time of the given function
and writes that to the
StatsD timing identified by key
.
This function returns the value returned by function
, making it suitable for
easily wrapping existing code.
Examples
iex> MyApp.Statix.measure("integer_to_string", [], fn -> Integer.to_string(123) end)
"123"
Callback implementation for Statix.measure/3
.
Writes the given value
to the StatsD set identified by key
.
Examples
iex> MyApp.Statix.set("unique_visitors", "user1", [])
:ok
Callback implementation for Statix.set/3
.
Writes the given value
to the StatsD timing identified by key
.
value
is expected in milliseconds.
Examples
iex> MyApp.Statix.timing("rendering", 12, [])
:ok
Callback implementation for Statix.timing/3
.