-
Notifications
You must be signed in to change notification settings - Fork 255
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
metrics: add running metrics for grpc #639
Open
bufferflies
wants to merge
7
commits into
tikv:master
Choose a base branch
from
bufferflies:metrics
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a086c63
metrics for grpc
bufferflies 9997865
add wait duration
bufferflies df91682
out of index
bufferflies f2ba50f
use prometheus as optional depence
bufferflies 2de40d2
enable prometheus
bufferflies 291d193
cargo
8a3c9a2
address comment
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ mod env; | |
mod error; | ||
mod log_util; | ||
mod metadata; | ||
mod metrics; | ||
mod quota; | ||
mod security; | ||
mod server; | ||
|
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,43 @@ | ||
// Copyright 2023 TiKV Project Authors. Licensed under Apache-2.0. | ||
|
||
//! Metrics of the grpc pool. | ||
|
||
use lazy_static::lazy_static; | ||
use prometheus::*; | ||
|
||
lazy_static! { | ||
/// Grpc wait duration of one task. | ||
pub static ref GRPC_TASK_WAIT_DURATION: HistogramVec = register_histogram_vec!( | ||
"grpc_task_wait_duration", | ||
"Bucketed histogram of grpc wait time only for Spawn task", | ||
&["name"], | ||
exponential_buckets(1e-7, 2.0, 20).unwrap() // 100ns ~ 100ms | ||
) | ||
.unwrap(); | ||
|
||
// Grpc pool io handle duration . | ||
pub static ref GRPC_POOL_IO_HANDLE_DURATION: HistogramVec = register_histogram_vec!( | ||
"grpc_pool_io_handle_duration", | ||
bufferflies marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"Bucketed histogram of grpc pool wait duration from the completion queue", | ||
&["name"], | ||
exponential_buckets(1e-7, 2.0, 20).unwrap() // 100ns ~ 100ms | ||
) | ||
.unwrap(); | ||
|
||
// Grpc handle execute duration | ||
pub static ref GRPC_POOL_EXECUTE_DURATION: HistogramVec = register_histogram_vec!( | ||
"grpc_pool_execute_duration", | ||
"Bucketed histogram of grpc pool execute duration for every time", | ||
&["name"], | ||
exponential_buckets(1e-7, 2.0, 20).unwrap() // 100ns ~ 100ms | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 100ms upper bound is too small here, maybe set the range to 10us~10s is better here. |
||
) | ||
.unwrap(); | ||
|
||
// Grpc pool event count task . | ||
pub static ref GRPC_POOL_EVENT_COUNT_VEC: IntCounterVec = register_int_counter_vec!( | ||
"grpc_pool_event_task_count", | ||
"Total event task count in grpc pool", | ||
&["name","event"] | ||
) | ||
.unwrap(); | ||
} |
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
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.