Alarmist.Event (alarmist v0.4.0)
View SourceStruct sent to subscribers on property changes
:id- which alarm:state-:setor:clear:description- alarm description ornilwhen the alarm has been cleared:level- alarm severity if known to Alarmist. Defaults to:warning:timestamp- the timestamp (System.monotonic_time/0) when the changed happened. Seetimestamp_to_utc/2for UTC conversion.:previous_state- the previous alarm state (:unknownif no previous information).:previous_timestamp- the timestamp when the property changed to:previous_state. Seetimestamp_to_utc/2for UTC conversion.
Summary
Functions
Convert the event's monotonic timestamp to UTC
Returns a monotonic time to UTC time mapping
Types
@type t() :: %Alarmist.Event{ description: Alarmist.alarm_description(), id: Alarmist.alarm_id(), level: Logger.level(), previous_state: Alarmist.alarm_state(), previous_timestamp: integer(), state: Alarmist.alarm_state(), timestamp: integer() }
Functions
@spec timestamp_to_utc( integer(), {integer(), DateTime.t()} ) :: DateTime.t()
Convert the event's monotonic timestamp to UTC
@spec utc_conversion() :: {integer(), DateTime.t()}
Returns a monotonic time to UTC time mapping
This is used by timestamp_to_utc/2 by default, but it's possible to supply
a custom mapping for unit test or performance reasons.
The monotonic time is in native time units.