Documentation ¶
Overview ¶
Package process runs Agent processes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Params ¶
Params represent Agent process parameters: command path, command-line arguments/flags, and process environment.
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process represents Agent process started by pmm-agent.
Process object should be created with New and started with Run (typically in a separate goroutine). It then handles process starting, restarting with backoff, reading its output. Process is gracefully stopped when context passed to New is canceled. Changes of process status are reported via Changes channel which must be read until it is closed.
Process status is changed by finite state machine (see agent_status.dot). Each state logic is encapsulated in toXXX methods. Each method sends a new status to the changes channel, implements its own logic, and then switches to then next state via "go toXXX()". "go" statement is used only to avoid stack overflow; there are no extra goroutines for states.
func (*Process) Changes ¶
func (p *Process) Changes() <-chan inventorypb.AgentStatus
Changes returns channel that should be read until it is closed.