Instruments v1.1.2 Instruments.StatsReporter behaviour
A behavoiur for reporters.
Reporters emit values back to the underlying reporting system.
Out of the box, Instruments provides Instruments.Statix
, Instruments.StatsReporter.Logger
,
and Instruments.StatsReporter.Null
reporters.
Link to this section Summary
Callbacks
Connect to the reporter. This function is called by the system prior to using the reporter, any connections should be established in this function
Decrement a key by the specified value
Set the value of the key to the specified value
Include the value in the histogram defined by key
Increment a key by the specified value
Measure the execution time of the provided function and
include it in the metric defined by key
Write the value into the set defined by key
Include the timing in the key
Link to this section Types
key()
key() :: String.t()
key() :: String.t()
stats_return()
stats_return() :: :ok | {:error, term()}
stats_return() :: :ok | {:error, term()}
Link to this section Callbacks
connect()
connect() :: :ok
connect() :: :ok
Connect to the reporter. This function is called by the system prior to using the reporter, any connections should be established in this function.
decrement(key, integer, keyword)
decrement(key(), integer(), keyword()) :: stats_return()
decrement(key(), integer(), keyword()) :: stats_return()
Decrement a key by the specified value
gauge(key, integer, keyword)
gauge(key(), integer(), keyword()) :: stats_return()
gauge(key(), integer(), keyword()) :: stats_return()
Set the value of the key to the specified value
histogram(key, integer, keyword)
histogram(key(), integer(), keyword()) :: stats_return()
histogram(key(), integer(), keyword()) :: stats_return()
Include the value in the histogram defined by key
increment(key, integer, keyword)
increment(key(), integer(), keyword()) :: stats_return()
increment(key(), integer(), keyword()) :: stats_return()
Increment a key by the specified value
measure(key, keyword, function)
Measure the execution time of the provided function and
include it in the metric defined by key
set(key, integer, keyword)
set(key(), integer(), keyword()) :: stats_return()
set(key(), integer(), keyword()) :: stats_return()
Write the value into the set defined by key
timing(key, integer, keyword)
timing(key(), integer(), keyword()) :: stats_return()
timing(key(), integer(), keyword()) :: stats_return()
Include the timing in the key