ZenMonitor v1.0.0 ZenMonitor.Local.State View Source

Maintains the internal state for ZenMonitor.Local

  • subscribers is an ETS table that tracks local subscribers to prevent multiple monitors
  • batch is the queue of messages awaiting delivery to ZenMonitor.Local.Dispatcher
  • length is the current length of the batch queue (calculating queue length is an O(n) operation, it is simple to track it as elements are added / removed)
  • queue_emptied is the number of times the queue has been emptied. Once this number exceeds the hibernation_threshold (see hibernation_threshold/0) the process will hibernate

Link to this section Summary

Link to this section Types

Link to this type t() View Source
t() :: %ZenMonitor.Local.State{
  batch: :queue.queue(),
  length: integer(),
  queue_emptied: integer(),
  subscribers: :ets.tid()
}