Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent represents an instance of a monitor agent. It runs a monitor to read events from the BPF perf ring buffer and provides an interface to also pass in non-BPF events.
func (*Agent) SendEvent ¶
SendEvent sends an event to the node monitor which will then distribute to all monitor listeners
func (*Agent) State ¶
func (a *Agent) State() *models.MonitorStatus
State returns the monitor status.
type Monitor ¶
Monitor structure for centralizing the responsibilities of the main events reader. There is some racey-ness around perfReaderCancel since it replaces on every perf reader start. In the event that a MonitorListener from a previous generation calls its cleanup after the start of the new perf reader, we might call the new, and incorrect, cancel function. We guard for this by checking the number of listeners during the cleanup call. The perf reader must have at least one MonitorListener (since it started) so no cancel is called. If it doesn't, the cancel is the correct behavior (the older generation cancel must have been called for us to get this far anyway).
func NewMonitor ¶
NewMonitor creates a Monitor, and starts client connection handling and agent event handling. Note that the perf buffer reader is started only when listeners are connected.
func (*Monitor) Status ¶
func (m *Monitor) Status() *models.MonitorStatus
Status returns the current status of the monitor