Alchemetrics v0.5.2 Alchemetrics.ConsoleBackend View Source
Backend to print the datasets measurements on the console.
Using it with IEx
iex(1)> Alchemetrics.ConsoleBackend.enable
:ok
Starting Elixir.Alchemetrics.ConsoleBackend with following options: []
iex(2)> Alchemetrics.increment(:my_metric)
:ok
iex(3)> Alchemetrics.increment(:my_metric)
:ok
iex(4)> Alchemetrics.increment(:my_metric)
:ok
iex(5)> %{datapoint: :last_interval, name: :my_metric, options: [], value: 3}
%{datapoint: :total, name: :my_metric, options: [], value: 3}
Starting on application boot
To start Alchemetrics.ConsoleBackend
at application boot, just add it to the :backends
config option. Start up parameters are set in opts
option.
# on config/config.exs
config :alchemetrics, backends: [
{Alchemetrics.ConsoleBackend, []}
]
Link to this section Summary
Functions
Disables the reporter. All subscribed data sets will unsubscribe from this reporter
Enables the reporter. All datasets created after the reporter is enabled will subscribe to this reporter
Callback implementation for Alchemetrics.CustomBackend.init/1
Callback implementation for Alchemetrics.CustomBackend.report/4
Link to this section Functions
Disables the reporter. All subscribed data sets will unsubscribe from this reporter.
Enables the reporter. All datasets created after the reporter is enabled will subscribe to this reporter.
Params
options
: Start up options.
Callback implementation for Alchemetrics.CustomBackend.init/1
.
Callback implementation for Alchemetrics.CustomBackend.report/4
.