Sooth.Statistic (Sooth v0.3.0)
A simple data structure for tracking event counts.
Summary
Types
@type t() :: %Sooth.Statistic{count: non_neg_integer(), event: non_neg_integer()}
A Statistic of event/count
Functions
Link to this function
increment(statistic)
Increment the count of a statistic.
Examples
iex> Sooth.Statistic.increment(%Sooth.Statistic{event: 0, count: 0})
%Sooth.Statistic{event: 0, count: 1}
Link to this function
new(event, count)
@spec new(non_neg_integer(), non_neg_integer()) :: t()
Create a new statistic.
Examples
iex> Sooth.Statistic.new(0, 0)
%Sooth.Statistic{event: 0, count: 0}