-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
ab4c20b
commit 5c6b0ef
Showing
12 changed files
with
770 additions
and
4 deletions.
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.