Documentation ¶
Overview ¶
Package agents contains business logic of working with pmm-agent.
Index ¶
- type Registry
- func (r *Registry) CheckConnectionToService(ctx context.Context, q *reform.Querier, service *models.Service, ...) 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) StartMongoDBExplainAction(ctx context.Context, id, pmmAgentID, dsn, query string) error
- func (r *Registry) StartMongoDBQueryBuildInfoAction(ctx context.Context, id, pmmAgentID, dsn string) error
- func (r *Registry) StartMongoDBQueryGetCmdLineOptsAction(ctx context.Context, id, pmmAgentID, dsn string) error
- func (r *Registry) StartMongoDBQueryGetParameterAction(ctx context.Context, id, pmmAgentID, dsn string) error
- func (r *Registry) StartMySQLExplainAction(ctx context.Context, id, pmmAgentID, dsn, query string, ...) error
- func (r *Registry) StartMySQLQuerySelectAction(ctx context.Context, id, pmmAgentID, dsn, query string) error
- func (r *Registry) StartMySQLQueryShowAction(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) StartPostgreSQLQuerySelectAction(ctx context.Context, id, pmmAgentID, dsn, query string) error
- func (r *Registry) StartPostgreSQLQueryShowAction(ctx context.Context, id, pmmAgentID, dsn 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 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) 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) 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 ¶
StopAction stops action with given given id. TODO: Extract it from here: https://jira.percona.com/browse/PMM-4932