agents

package
v2.0.0-alpha5+incompat... Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package agents contains business logic of working with pmm-agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry keeps track of all connected pmm-agents.

TODO Split into several types?

func NewRegistry

func NewRegistry(db *reform.DB, prometheus prometheus, qanClient qanClient) *Registry

NewRegistry creates a new registry with given database connection.

func (*Registry) CheckConnectionToService

func (r *Registry) CheckConnectionToService(ctx context.Context, service *models.Service, agent *models.Agent) error

CheckConnectionToService sends request to pmm-agent to check connection to service.

func (*Registry) Collect

func (r *Registry) Collect(ch chan<- prom.Metric)

Collect implement prometheus.Collector.

func (*Registry) Describe

func (r *Registry) Describe(ch chan<- *prom.Desc)

Describe implements prometheus.Collector.

func (*Registry) IsConnected

func (r *Registry) IsConnected(pmmAgentID string) bool

IsConnected returns true if pmm-agent with given ID is currently connected, false otherwise.

func (*Registry) Kick

func (r *Registry) Kick(ctx context.Context, pmmAgentID string)

Kick disconnects pmm-agent with given ID.

func (*Registry) Run

func (r *Registry) Run(stream agentpb.Agent_ConnectServer) error

Run takes over pmm-agent gRPC stream and runs it until completion.

func (*Registry) SendSetStateRequest

func (r *Registry) SendSetStateRequest(ctx context.Context, pmmAgentID string)

SendSetStateRequest sends SetStateRequest to pmm-agent with given ID.

Directories

Path Synopsis
Package channel contains protocol details of two-way communication channel between pmm-managed and pmm-agent.
Package channel contains protocol details of two-way communication channel between pmm-managed and pmm-agent.

Jump to

Keyboard shortcuts

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