Beaker.Gauge

Beaker.Gauge is a simple gauge. It’s a metric where a value can be set and retrieved.

It is commonly used for metrics that return a single value.

Examples are:

Source

Summary

get(key)

Retrieves the current value of the specified gauge

set(key, value)

Sets the gauge to the specified value

Functions

get(key)

Retrieves the current value of the specified gauge.

Parameters

  • key: The name of the gauge to retrieve.

Examples

iex> Beaker.Gauge.set("get_gauge", 50)
:ok
iex> Beaker.Gauge.get("get_gauge")
50

Returns count where count is an integer if the gauge exists, else nil.

Source
set(key, value)

Sets the gauge to the specified value.

Parameters

  • key: The name of the gauge to set the value for.
  • value: The value to set to the gauge.

Examples

iex> Beaker.Gauge.set("set_gauge", 3.14159)
:ok
iex> Beaker.Gauge.get("set_gauge")
3.14159

Returns :ok

Source