agents

package
v2.0.0-beta7+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: AGPL-3.0 Imports: 19 Imported by: 3

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 prometheusService, 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.

func (*Registry) StartMySQLExplainAction

func (r *Registry) StartMySQLExplainAction(ctx context.Context, id, pmmAgentID, dsn, query string, format agentpb.MysqlExplainOutputFormat) error

StartMySQLExplainAction starts MySQL EXPLAIN Action on pmm-agent. TODO: Extract it from here. Where...?

func (*Registry) StartMySQLShowCreateTableAction

func (r *Registry) StartMySQLShowCreateTableAction(ctx context.Context, id, pmmAgentID, dsn, table string) error

StartMySQLShowCreateTableAction starts mysql-show-create-table action on pmm-agent. TODO: Extract it from here. Where...?

func (*Registry) StartMySQLShowIndexAction

func (r *Registry) StartMySQLShowIndexAction(ctx context.Context, id, pmmAgentID, dsn, table string) error

StartMySQLShowIndexAction starts mysql-show-index action on pmm-agent. TODO: Extract it from here. Where...?

func (*Registry) StartMySQLShowTableStatusAction

func (r *Registry) StartMySQLShowTableStatusAction(ctx context.Context, id, pmmAgentID, dsn, table string) error

StartMySQLShowTableStatusAction starts mysql-show-table-status action on pmm-agent. TODO: Extract it from here. Where...?

func (*Registry) StartPTMySQLSummaryAction

func (r *Registry) StartPTMySQLSummaryAction(ctx context.Context, id, pmmAgentID string, args []string) error

StartPTMySQLSummaryAction starts pt-mysql-summary action on pmm-agent. TODO: Extract it from here. Where...?

func (*Registry) StartPTSummaryAction

func (r *Registry) StartPTSummaryAction(ctx context.Context, id, pmmAgentID string, args []string) error

StartPTSummaryAction starts pt-summary action on pmm-agent. TODO: Extract it from here. Where...?

func (*Registry) StartPostgreSQLShowCreateTableAction

func (r *Registry) StartPostgreSQLShowCreateTableAction(ctx context.Context, id, pmmAgentID, dsn, table string) error

StartPostgreSQLShowCreateTableAction starts postgresql-show-create-table action on pmm-agent. TODO: Extract it from here. Where...?

func (*Registry) StartPostgreSQLShowIndexAction

func (r *Registry) StartPostgreSQLShowIndexAction(ctx context.Context, id, pmmAgentID, dsn, table string) error

StartPostgreSQLShowIndexAction starts postgresql-show-index action on pmm-agent. TODO: Extract it from here. Where...?

func (*Registry) StopAction

func (r *Registry) StopAction(ctx context.Context, actionID string) error

StopAction stops action with given given id. TODO: Extract it from here. Where...?

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