agents

package
v2.9.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: AGPL-3.0 Imports: 23 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 https://jira.percona.com/browse/PMM-4932

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, q *reform.Querier, 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) StartMongoDBExplainAction

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

StartMongoDBExplainAction starts MongoDB query explain action on pmm-agent.

func (*Registry) StartMongoDBQueryBuildInfoAction

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

StartMongoDBQueryBuildInfoAction starts MongoDB buildInfo query action on pmm-agent.

func (*Registry) StartMongoDBQueryGetCmdLineOptsAction

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

StartMongoDBQueryGetCmdLineOptsAction starts MongoDB getCmdLineOpts query action on pmm-agent.

func (*Registry) StartMongoDBQueryGetParameterAction

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

StartMongoDBQueryGetParameterAction starts MongoDB getParameter query action on pmm-agent.

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: https://jira.percona.com/browse/PMM-4932

func (*Registry) StartMySQLQuerySelectAction

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

StartMySQLQuerySelectAction starts MySQL SELECT query action on pmm-agent.

func (*Registry) StartMySQLQueryShowAction

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

StartMySQLQueryShowAction starts MySQL SHOW query action on pmm-agent.

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: https://jira.percona.com/browse/PMM-4932

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: https://jira.percona.com/browse/PMM-4932

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: https://jira.percona.com/browse/PMM-4932

func (*Registry) StartPostgreSQLQuerySelectAction

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

StartPostgreSQLQuerySelectAction starts PostgreSQL SELECT query action on pmm-agent.

func (*Registry) StartPostgreSQLQueryShowAction

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

StartPostgreSQLQueryShowAction starts PostgreSQL SHOW query action on pmm-agent.

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: https://jira.percona.com/browse/PMM-4932

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: https://jira.percona.com/browse/PMM-4932

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: https://jira.percona.com/browse/PMM-4932

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