Documentation ¶
Overview ¶
Package agents contains business logic of working with pmm-agent.
Index ¶
- type Registry
- func (r *Registry) CheckConnectionToService(ctx context.Context, service *models.Service, agent *models.Agent) error
- func (r *Registry) Collect(ch chan<- prom.Metric)
- func (r *Registry) Describe(ch chan<- *prom.Desc)
- func (r *Registry) IsConnected(pmmAgentID string) bool
- func (r *Registry) Kick(ctx context.Context, pmmAgentID string)
- func (r *Registry) Run(stream agentpb.Agent_ConnectServer) error
- func (r *Registry) SendSetStateRequest(ctx context.Context, pmmAgentID string)
- func (r *Registry) StartMySQLExplainAction(ctx context.Context, id, pmmAgentID, dsn, query string, ...) error
- func (r *Registry) StartMySQLShowCreateTableAction(ctx context.Context, id, pmmAgentID, dsn, table string) error
- func (r *Registry) StartMySQLShowIndexAction(ctx context.Context, id, pmmAgentID, dsn, table string) error
- func (r *Registry) StartMySQLShowTableStatusAction(ctx context.Context, id, pmmAgentID, dsn, table string) error
- func (r *Registry) StartPTMySQLSummaryAction(ctx context.Context, id, pmmAgentID string, args []string) error
- func (r *Registry) StartPTSummaryAction(ctx context.Context, id, pmmAgentID string, args []string) error
- func (r *Registry) StartPostgreSQLShowCreateTableAction(ctx context.Context, id, pmmAgentID, dsn, table string) error
- func (r *Registry) StartPostgreSQLShowIndexAction(ctx context.Context, id, pmmAgentID, dsn, table string) error
- func (r *Registry) StopAction(ctx context.Context, actionID string) error
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) IsConnected ¶
IsConnected returns true if pmm-agent with given ID is currently connected, false otherwise.
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 ¶
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...?