Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

PMM-4648 Rotate slowlogs.#264

Merged
AlekSi merged 14 commits intoPMM-2.0from
PMM-4437-flush-slowlogs
Sep 13, 2019
Merged

PMM-4648 Rotate slowlogs.#264
AlekSi merged 14 commits intoPMM-2.0from
PMM-4437-flush-slowlogs

Conversation

@askomorokhov
Copy link
Contributor

@askomorokhov askomorokhov commented Sep 9, 2019

https://jira.percona.com/browse/PMM-4459
https://jira.percona.com/browse/PMM-4437

depends on:
percona/pmm-admin#59
#264
percona/qan-app#322

FB:
Percona-Lab/pmm-submodules#444
usage ex.:
pmm-admin add mysql --username=root --password=secret ps:3306 MySQLSlowLog --size-slow-logs=10MB

Copy link
Contributor

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should:

  • return values in API;
  • handle value in Inventory API: any negative value means 0;
  • handle default value in Management API: 0 means 1GB, negative value means 0.

Gopkg.toml Outdated
name = "github.com/percona/pmm"
branch = "PMM-2.0"
#branch = "PMM-2.0"
branch = "PMM-4437-flush-slowlogs"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged with changes

@askomorokhov askomorokhov requested a review from AlekSi September 11, 2019 17:50
@codecov
Copy link

codecov bot commented Sep 11, 2019

Codecov Report

Merging #264 into PMM-2.0 will decrease coverage by 0.01%.
The diff coverage is 41.23%.

Impacted file tree graph

@@             Coverage Diff             @@
##           PMM-2.0     #264      +/-   ##
===========================================
- Coverage     43.9%   43.88%   -0.02%     
===========================================
  Files           79       79              
  Lines         8168     8203      +35     
===========================================
+ Hits          3586     3600      +14     
- Misses        4303     4323      +20     
- Partials       279      280       +1
Flag Coverage Δ
#cover 48.12% <26.02%> (-0.13%) ⬇️
#crosscover 43.88% <41.23%> (ø) ⬆️
#devcontainer 21% <11.11%> (+0.06%) ⬆️
#normal 41.09% <41.23%> (-0.02%) ⬇️
Impacted Files Coverage Δ
models/agent_model.go 96.59% <ø> (ø) ⬆️
models/database.go 57.14% <ø> (ø) ⬆️
services/agents/mysql.go 82.22% <0%> (-2.84%) ⬇️
services/management/mysql.go 0% <0%> (ø) ⬆️
services/agents/mongodb.go 76.92% <0%> (-2.03%) ⬇️
services/management/mongodb.go 0% <0%> (ø) ⬆️
models/agent_model_reform.go 91.39% <100%> (+0.59%) ⬆️
models/agent_helpers.go 58.44% <100%> (+0.27%) ⬆️
services/inventory/agents.go 39.08% <45.45%> (-0.03%) ⬇️
services/converters.go 66.13% <50%> (-0.27%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99a748f...bf7d328. Read the comment docs.

# Conflicts:
#	Gopkg.lock
#	vendor/github.com/percona/pmm/api/agentpb/agent.pb.go
_, err = db.Exec(
"INSERT INTO agents (agent_id, agent_type, runs_on_node_id, disabled, status, created_at, updated_at, "+
"tls, tls_skip_verify) VALUES ('/agent_id/1', 'pmm-agent', '/node_id/1', false, '', $1, $2, false, false)",
"INSERT INTO agents (agent_id, agent_type, runs_on_node_id, pmm_agent_id, disabled, status, created_at, updated_at, tls, tls_skip_verify, query_examples_disabled, max_query_log_size) "+

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line is 197 characters (from lll)

_, err = db.Exec(
"INSERT INTO agents (agent_id, agent_type, runs_on_node_id, pmm_agent_id, disabled, status, created_at, updated_at, "+
"tls, tls_skip_verify) VALUES ('/agent_id/2', 'pmm-agent', '/node_id/1', NULL, false, '', $1, $2, false, false)",
"INSERT INTO agents (agent_id, agent_type, runs_on_node_id, pmm_agent_id, disabled, status, created_at, updated_at, tls, tls_skip_verify, query_examples_disabled, max_query_log_size) "+

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line is 197 characters (from lll)

_, err = db.Exec(
"INSERT INTO agents (agent_id, agent_type, runs_on_node_id, pmm_agent_id, disabled, status, created_at, updated_at, "+
"tls, tls_skip_verify) VALUES ('/agent_id/3', 'mysqld_exporter', NULL, '/agent_id/1', false, '', $1, $2, false, false)",
"INSERT INTO agents (agent_id, agent_type, runs_on_node_id, pmm_agent_id, disabled, status, created_at, updated_at, tls, tls_skip_verify, query_examples_disabled, max_query_log_size) "+

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line is 197 characters (from lll)

@AlekSi AlekSi requested a review from BupycHuk September 12, 2019 19:32
@AlekSi AlekSi assigned AlekSi and unassigned askomorokhov Sep 12, 2019
4: {
`ALTER TABLE agents
ADD COLUMN query_examples_disabled BOOLEAN NOT NULL DEFAULT FALSE,
ADD COLUMN max_query_log_size INTEGER NOT NULL DEFAULT 0`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like we might need extra table or json column for params based on agent_type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not now of course

@AlekSi AlekSi merged commit ef14cfc into PMM-2.0 Sep 13, 2019
@AlekSi AlekSi deleted the PMM-4437-flush-slowlogs branch September 13, 2019 10:45
askomorokhov added a commit that referenced this pull request Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants