-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: add global sort related metric and fix cancel add index #47485
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
92912ef
temp
wjhuang2016 a2fae1d
try
wjhuang2016 8afb6b3
test
wjhuang2016 9a8c2b8
fix
wjhuang2016 0d94923
try
wjhuang2016 eac3a23
debug
wjhuang2016 e9040fd
fix
wjhuang2016 8d1908f
Merge branch 'master' of https://github.com/pingcap/tidb into add_metric
wjhuang2016 bfa8343
try
wjhuang2016 5cdf73a
fix
wjhuang2016 0163f95
merge
wjhuang2016 71fb3b1
done
wjhuang2016 7dfbdac
fix bazel
wjhuang2016 b5b27e3
refine
wjhuang2016 7d0be36
refine
wjhuang2016 20c0878
refine
wjhuang2016 ba04a2d
comment
wjhuang2016 6709be1
fix
wjhuang2016 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 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 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 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 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 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 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 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 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 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 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,72 @@ | ||
// Copyright 2023 PingCAP, Inc. | ||
// | ||
// 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 metrics | ||
|
||
import "github.com/prometheus/client_golang/prometheus" | ||
|
||
var ( | ||
// GlobalSortWriteToCloudStorageDuration records the duration of writing to cloud storage. | ||
GlobalSortWriteToCloudStorageDuration *prometheus.HistogramVec | ||
// GlobalSortWriteToCloudStorageRate records the rate of writing to cloud storage. | ||
GlobalSortWriteToCloudStorageRate *prometheus.HistogramVec | ||
// GlobalSortReadFromCloudStorageDuration records the duration of reading from cloud storage. | ||
GlobalSortReadFromCloudStorageDuration *prometheus.HistogramVec | ||
// GlobalSortReadFromCloudStorageRate records the rate of reading from cloud storage. | ||
GlobalSortReadFromCloudStorageRate *prometheus.HistogramVec | ||
// GlobalSortIngestWorkerCnt records the working number of ingest workers. | ||
GlobalSortIngestWorkerCnt *prometheus.GaugeVec | ||
) | ||
|
||
// InitGlobalSortMetrics initializes defines global sort metrics. | ||
func InitGlobalSortMetrics() { | ||
GlobalSortWriteToCloudStorageDuration = NewHistogramVec(prometheus.HistogramOpts{ | ||
Namespace: "tidb", | ||
Subsystem: "global_sort", | ||
Name: "write_to_cloud_storage_duration", | ||
Help: "write to cloud storage duration", | ||
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms ~ 524s | ||
}, []string{LblType}) | ||
|
||
GlobalSortWriteToCloudStorageRate = NewHistogramVec(prometheus.HistogramOpts{ | ||
Namespace: "tidb", | ||
Subsystem: "global_sort", | ||
Name: "write_to_cloud_storage_rate", | ||
Help: "write to cloud storage rate", | ||
Buckets: prometheus.ExponentialBuckets(0.05, 2, 20), | ||
}, []string{LblType}) | ||
|
||
GlobalSortReadFromCloudStorageDuration = NewHistogramVec(prometheus.HistogramOpts{ | ||
Namespace: "tidb", | ||
Subsystem: "global_sort", | ||
Name: "read_from_cloud_storage_duration", | ||
Help: "read from cloud storage duration", | ||
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), | ||
}, []string{LblType}) | ||
|
||
GlobalSortReadFromCloudStorageRate = NewHistogramVec(prometheus.HistogramOpts{ | ||
Namespace: "tidb", | ||
Subsystem: "global_sort", | ||
Name: "read_from_cloud_storage_rate", | ||
Help: "read from cloud storage rate", | ||
Buckets: prometheus.ExponentialBuckets(0.05, 2, 20), | ||
}, []string{LblType}) | ||
|
||
GlobalSortIngestWorkerCnt = NewGaugeVec(prometheus.GaugeOpts{ | ||
Namespace: "tidb", | ||
Subsystem: "global_sort", | ||
Name: "ingest_worker_cnt", | ||
Help: "ingest worker cnt", | ||
}, []string{LblType}) | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for hot path we should cache the result of
WithLabelValues
to avoid the inner lookup.