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)

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

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.

Link to this function count(metadata, metric, num) View Source

Callback implementation for Rheostat.Adapter.count/3.

Link to this function decrement(key, val \\ 1, options \\ []) View Source

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.

Link to this function gauge(key, val, options \\ []) View Source

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.

Link to this function histogram(key, val, options \\ []) View Source

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.

Link to this function increment(key, val \\ 1, options \\ []) View Source

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.

Link to this function measure(metadata, key, fun) View Source

Callback implementation for Rheostat.Adapter.measure/3.

Link to this function sample(metadata, metric, value) View Source
sample(any(), binary() | maybe_improper_list(), any()) :: any()

Callback implementation for Rheostat.Adapter.sample/3.

Link to this function set(key, val, options \\ []) View Source

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", ...]

Link to this function timing(key, val, options \\ []) View Source

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.