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

Commit 7ebc053

Browse files
committed
Unify names.
1 parent 931a101 commit 7ebc053

File tree

7 files changed

+45
-45
lines changed

7 files changed

+45
-45
lines changed

glide.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import:
2020
- src/go/mongolib/stats
2121
- package: github.com/percona/pmgo
2222
- package: github.com/percona/pmm
23-
version: ea154592a8690b95ef8584b9817fc9bfcaf2a88e
23+
version: 88b7a3ea548f89aa63c3ec946c5a20db949db715
2424
subpackages:
2525
- proto
2626
- proto/config

qan/analyzer/mysql/config/config.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import (
2929
var (
3030
DefaultInterval uint = 60 // 1 minute
3131
DefaultMaxSlowLogSize int64 = 1073741824 // 1G
32-
DefaultSlowLogsRotation = true // whether to rotate slow logs
32+
DefaultSlowLogRotation = true // whether to rotate slow logs
3333
DefaultRemoveOldSlowLogs = true // whether to remove old slow logs after rotation
34-
DefaultSlowLogsToKeep = 1 // how many slow logs to keep on filesystem
34+
DefaultRetainSlowLogs = 1 // how many slow logs to keep on filesystem
3535
DefaultExampleQueries = true
3636
// internal
3737
DefaultWorkerRuntime uint = 55
@@ -114,9 +114,9 @@ func ValidateConfig(setConfig pc.QAN) (pc.QAN, error) {
114114
Interval: DefaultInterval,
115115
ExampleQueries: new(bool),
116116
// "slowlog" specific options.
117-
MaxSlowLogSize: DefaultMaxSlowLogSize,
118-
SlowLogsRotation: new(bool),
119-
SlowLogsToKeep: new(int),
117+
MaxSlowLogSize: DefaultMaxSlowLogSize,
118+
SlowLogRotation: new(bool),
119+
RetainSlowLogs: new(int),
120120
// internal
121121
WorkerRunTime: DefaultWorkerRuntime,
122122
ReportLimit: DefaultReportLimit,
@@ -129,13 +129,13 @@ func ValidateConfig(setConfig pc.QAN) (pc.QAN, error) {
129129
if setConfig.ExampleQueries != nil {
130130
runConfig.ExampleQueries = setConfig.ExampleQueries
131131
}
132-
*runConfig.SlowLogsRotation = DefaultSlowLogsRotation
133-
if setConfig.SlowLogsRotation != nil {
134-
runConfig.SlowLogsRotation = setConfig.SlowLogsRotation
132+
*runConfig.SlowLogRotation = DefaultSlowLogRotation
133+
if setConfig.SlowLogRotation != nil {
134+
runConfig.SlowLogRotation = setConfig.SlowLogRotation
135135
}
136-
*runConfig.SlowLogsToKeep = DefaultSlowLogsToKeep
137-
if setConfig.SlowLogsToKeep != nil {
138-
runConfig.SlowLogsToKeep = setConfig.SlowLogsToKeep
136+
*runConfig.RetainSlowLogs = DefaultRetainSlowLogs
137+
if setConfig.RetainSlowLogs != nil {
138+
runConfig.RetainSlowLogs = setConfig.RetainSlowLogs
139139
}
140140

141141
// Strings

qan/analyzer/mysql/mysql.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ func (m *MySQLAnalyzer) Stop() error {
188188
func (m *MySQLAnalyzer) GetDefaults(uuid string) map[string]interface{} {
189189
// Configuration
190190
cfg := map[string]interface{}{
191-
"CollectFrom": m.config.CollectFrom,
192-
"Interval": m.config.Interval,
193-
"MaxSlowLogSize": config.DefaultMaxSlowLogSize,
194-
"SlowLogsToKeep": m.config.SlowLogsToKeep,
195-
"SlowLogsRotation": m.config.SlowLogsRotation,
196-
"ExampleQueries": m.config.ExampleQueries,
197-
"WorkerRunTime": config.DefaultWorkerRuntime,
198-
"ReportLimit": config.DefaultReportLimit,
191+
"CollectFrom": m.config.CollectFrom,
192+
"Interval": m.config.Interval,
193+
"MaxSlowLogSize": config.DefaultMaxSlowLogSize,
194+
"RetainSlowLogs": m.config.RetainSlowLogs,
195+
"SlowLogRotation": m.config.SlowLogRotation,
196+
"ExampleQueries": m.config.ExampleQueries,
197+
"WorkerRunTime": config.DefaultWorkerRuntime,
198+
"ReportLimit": config.DefaultReportLimit,
199199
}
200200

201201
// Info from SHOW GLOBAL STATUS

qan/analyzer/mysql/worker/slowlog/slowlog_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,13 @@ func (s *WorkerTestSuite) TestRotateAndRemoveSlowLog(t *C) {
288288
slowLogsRotation := true
289289
slowLogsToKeep := 1
290290
config := pc.QAN{
291-
UUID: s.mysqlInstance.UUID,
292-
Interval: 300,
293-
MaxSlowLogSize: 1000, // <-- HERE
294-
ExampleQueries: &exampleQueries,
295-
SlowLogsRotation: &slowLogsRotation,
296-
SlowLogsToKeep: &slowLogsToKeep,
297-
WorkerRunTime: 600,
291+
UUID: s.mysqlInstance.UUID,
292+
Interval: 300,
293+
MaxSlowLogSize: 1000, // <-- HERE
294+
ExampleQueries: &exampleQueries,
295+
SlowLogRotation: &slowLogsRotation,
296+
RetainSlowLogs: &slowLogsToKeep,
297+
WorkerRunTime: 600,
298298
Start: []string{
299299
"-- start",
300300
},
@@ -391,13 +391,13 @@ func (s *WorkerTestSuite) TestRotateSlowLog(t *C) {
391391
slowLogsRotation := true
392392
slowLogsToKeep := 1
393393
config := pc.QAN{
394-
UUID: s.mysqlInstance.UUID,
395-
Interval: 300,
396-
MaxSlowLogSize: 1000,
397-
ExampleQueries: &exampleQueries,
398-
SlowLogsRotation: &slowLogsRotation,
399-
SlowLogsToKeep: &slowLogsToKeep,
400-
WorkerRunTime: 600,
394+
UUID: s.mysqlInstance.UUID,
395+
Interval: 300,
396+
MaxSlowLogSize: 1000,
397+
ExampleQueries: &exampleQueries,
398+
SlowLogRotation: &slowLogsRotation,
399+
RetainSlowLogs: &slowLogsToKeep,
400+
WorkerRunTime: 600,
401401
Start: []string{
402402
"-- start",
403403
},

qan/analyzer/mysql/worker/slowlog/worker.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type Job struct {
6565
StartOffset int64
6666
EndOffset int64
6767
ExampleQueries bool
68-
SlowLogsToKeep int
68+
RetainSlowLogs int
6969
}
7070

7171
func (j *Job) String() string {
@@ -142,7 +142,7 @@ func (w *Worker) Setup(interval *iter.Interval) error {
142142
w.logger.Debug("Setup:", interval)
143143

144144
// Check if slow log rotation is enabled.
145-
if boolValue(w.config.SlowLogsRotation) {
145+
if boolValue(w.config.SlowLogRotation) {
146146
// Check if max slow log size was reached.
147147
if interval.EndOffset >= w.config.MaxSlowLogSize {
148148
w.logger.Info(fmt.Sprintf("Rotating slow log: %s >= %s",
@@ -163,7 +163,7 @@ func (w *Worker) Setup(interval *iter.Interval) error {
163163
EndOffset: interval.EndOffset,
164164
RunTime: time.Duration(w.config.WorkerRunTime) * time.Second,
165165
ExampleQueries: boolValue(w.config.ExampleQueries),
166-
SlowLogsToKeep: intValue(w.config.SlowLogsToKeep),
166+
RetainSlowLogs: intValue(w.config.RetainSlowLogs),
167167
}
168168
w.logger.Debug("Setup:", w.job)
169169

@@ -446,11 +446,11 @@ func (w *Worker) rotateSlowLog(interval *iter.Interval) error {
446446
if err != nil {
447447
return err
448448
}
449-
if len(filesFound) <= intValue(w.config.SlowLogsToKeep) {
449+
if len(filesFound) <= intValue(w.config.RetainSlowLogs) {
450450
return nil
451451
}
452452
sort.Strings(filesFound)
453-
for _, f := range filesFound[:len(filesFound)-intValue(w.config.SlowLogsToKeep)] {
453+
for _, f := range filesFound[:len(filesFound)-intValue(w.config.RetainSlowLogs)] {
454454
w.status.Update(w.name, "Removing slow log "+f)
455455
if err := os.Remove(f); err != nil {
456456
w.logger.Warn(err)

vendor/github.com/percona/pmm/proto/config/config.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)