-
Notifications
You must be signed in to change notification settings - Fork 2.3k
vtbackup, mysqlctl: detailed backup and restore metrics #11979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
deepthi
merged 23 commits into
vitessio:main
from
planetscale:maxeng-details-backup-stats
Feb 14, 2023
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
be89e30
vtbackup, mysqlctl: detailed backup and restore metrics
maxenglander 1504861
move fakemysqldaemon.go to mysqlctl package
maxenglander 21d82f4
go/vt/mysqlctl: add backup/restore stats tests
maxenglander cc324e1
address pr comments round 1
maxenglander fef5519
checkpoint
maxenglander cdc748c
reorganize metric names
maxenglander 86871e2
track bytes processed in backup/restore
maxenglander 3d15817
address pr comments: remove 'this file' from comments
maxenglander b64eac4
Update go/vt/mysqlctl/backupstats/stats.go
maxenglander 6a01830
Update go/vt/mysqlctl/backupstats/stats.go
maxenglander d5364e6
Update go/vt/mysqlctl/backupstats/stats.go
maxenglander 9657a8d
pr review: improve comments
maxenglander 1142e5f
make stats more expvars-friendly
maxenglander a86ecc6
-backupstorage.Parameterizer, +backupstorage.BackupStorage.WithParams
maxenglander 71d0680
merge <- main
maxenglander 76cd27f
remove deleted field
maxenglander 05622d3
Merge branch 'main' into maxeng-details-backup-stats
maxenglander 8f97dd6
merge <- main
maxenglander 26b62de
Update go/ioutil/meter.go
maxenglander 143d47e
Update go/ioutil/meter.go
maxenglander bbb8fb3
Update go/ioutil/meter.go
maxenglander 49a5b94
-constants.go +release notes
maxenglander 7294e92
add stats example to release notes
maxenglander File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /* | ||
| Copyright 2022 The Vitess Authors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| // Package ioutil provides wrappers around golang IO interfaces. | ||
| package ioutil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /* | ||
| Copyright 2022 The Vitess Authors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| /* | ||
| The meter struct contains time-and-byte-tracking functionality used by | ||
| MeteredReader, MeteredReadCloser, MeteredWriter, MeteredWriteCloser. | ||
| */ | ||
|
|
||
| package ioutil | ||
|
|
||
| import "time" | ||
|
|
||
| // meter contains time-and-byte-tracking functionality. | ||
| type meter struct { | ||
| fs []func(b int, d time.Duration) | ||
| bytes int64 | ||
| duration time.Duration | ||
| } | ||
|
|
||
| // Bytes reports the total bytes processed in calls to measure(). | ||
| func (mtr *meter) Bytes() int64 { | ||
| return mtr.bytes | ||
| } | ||
|
|
||
| // Duration reports the total time spent in calls to measure(). | ||
| func (mtr *meter) Duration() time.Duration { | ||
| return mtr.duration | ||
| } | ||
|
|
||
| // measure tracks the time spent and bytes processed by f. Time is accumulated into total, | ||
| // and reported to callback fns. | ||
| func (mtr *meter) measure(f func(p []byte) (int, error), p []byte) (b int, err error) { | ||
| s := time.Now() | ||
| b, err = f(p) | ||
| d := time.Since(s) | ||
|
|
||
| mtr.bytes += int64(b) | ||
| mtr.duration += d | ||
|
|
||
| for _, cb := range mtr.fs { | ||
| cb(b, d) | ||
| } | ||
|
|
||
| return | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.