Rheostat v0.1.0 Rheostat.Adapter.Statix View Source
Provide a Statix adapter for Rheostat.
https://github.com/lexmag/statix
Link to this section Summary
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 Rheostat.Adapter.count/3
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
Writes to the StatsD gauge identified by key
.
Examples
iex> MyApp.Statix.gauge("cpu_usage", 0.83, [])
:ok
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
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 Rheostat.Adapter.measure/3
Callback implementation for Rheostat.Adapter.sample/3
Writes the given value
to the StatsD set identified by key
.
Examples
iex> MyApp.Statix.set("unique_visitors", "user1", [])
:ok
Create StatsD tags from a map of metadata
Writes the given value
to the StatsD timing identified by key
.
value
is expected in milliseconds.
Examples
iex> MyApp.Statix.timing("rendering", 12, [])
:ok
Link to this section 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 Rheostat.Adapter.connect/0
.
Callback implementation for Rheostat.Adapter.count/3
.
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 Rheostat.Adapter.decrement/3
.
Writes to the StatsD gauge identified by key
.
Examples
iex> MyApp.Statix.gauge("cpu_usage", 0.83, [])
:ok
Callback implementation for Rheostat.Adapter.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 Rheostat.Adapter.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 Rheostat.Adapter.increment/3
.
Callback implementation for Rheostat.Adapter.measure/3
.
sample(any(), binary() | maybe_improper_list(), any()) :: any()
Callback implementation for Rheostat.Adapter.sample/3
.
Writes the given value
to the StatsD set identified by key
.
Examples
iex> MyApp.Statix.set("unique_visitors", "user1", [])
:ok
Callback implementation for Rheostat.Adapter.set/3
.
Create StatsD tags from a map of metadata.
Returns a list of concatenated metadata: ["key1:value1", "key2:value2", ...]
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 Rheostat.Adapter.timing/3
.