agent

package
v1.6.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

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 NewAgent

func NewAgent(ctx context.Context, npages int) (a *Agent, err error)

NewAgent creates a new monitor agent

func (*Agent) SendEvent

func (a *Agent) SendEvent(typ int, event interface{}) error

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.

func (*Agent) Stop

func (a *Agent) Stop()

Stop stops the monitor agent

type Monitor

type Monitor struct {
	lock.Mutex
	// contains filtered or unexported fields
}

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

func NewMonitor(ctx context.Context, nPages int, server1_2 net.Listener) (m *Monitor, err error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL