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
*: directly report statistics to pd #2337
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0618283
move out pd work
nolouch 2606c8b
remove whitespace
nolouch 893a9ca
Merge branch 'master' into shuning/extract-pd
nolouch 7df14b3
pick up read report
nolouch 8697cad
fix test
nolouch 02b2003
merge master
nolouch 4ae5719
clean up
nolouch 33b6a32
address comment
nolouch 60ec974
--wip-- [skip ci]
nolouch d61b223
fix conflict
nolouch 4901ca8
fix metrics
nolouch 7398ac3
address comment
nolouch f9e04eb
address comment
nolouch 3d9c332
merge master
nolouch 8de7261
fix conflict
nolouch aad67c2
change to version
nolouch 06a33c0
tiny cleanup
nolouch 5e4e30b
address comment
nolouch 4cb0dc9
cleanup
nolouch cd69857
fix conflict
nolouch 5d2e6f8
address comment
nolouch 9a2705a
address comment
nolouch File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -62,7 +62,6 @@ use super::cmd_resp::{bind_term, new_error}; | |
use super::transport::Transport; | ||
use super::metrics::*; | ||
use super::local_metrics::RaftMetrics; | ||
use prometheus::local::LocalHistogram; | ||
|
||
type Key = Vec<u8>; | ||
|
||
|
@@ -91,8 +90,6 @@ pub struct StoreChannel { | |
} | ||
|
||
pub struct StoreStat { | ||
pub region_bytes_written: LocalHistogram, | ||
pub region_keys_written: LocalHistogram, | ||
pub lock_cf_bytes_written: u64, | ||
|
||
pub engine_total_bytes_written: u64, | ||
|
@@ -105,8 +102,6 @@ pub struct StoreStat { | |
impl Default for StoreStat { | ||
fn default() -> StoreStat { | ||
StoreStat { | ||
region_bytes_written: REGION_WRITTEN_BYTES_HISTOGRAM.local(), | ||
region_keys_written: REGION_WRITTEN_KEYS_HISTOGRAM.local(), | ||
lock_cf_bytes_written: 0, | ||
engine_total_bytes_written: 0, | ||
engine_total_keys_written: 0, | ||
|
@@ -1679,18 +1674,9 @@ impl<T: Transport, C: PdClient> Store<T, C> { | |
|
||
fn on_update_region_flow(&mut self) { | ||
for peer in self.region_peers.values_mut() { | ||
self.store_stat.region_bytes_written.observe( | ||
(peer.peer_stat.written_bytes - peer.peer_stat.last_written_bytes) as f64, | ||
); | ||
self.store_stat.region_keys_written.observe( | ||
(peer.peer_stat.written_keys - peer.peer_stat.last_written_keys) as f64, | ||
); | ||
|
||
peer.peer_stat.last_written_bytes = peer.peer_stat.written_bytes; | ||
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. can we save the last_written_bytes/keys in PD worker and update in the heartbeat msg? |
||
peer.peer_stat.last_written_keys = peer.peer_stat.written_keys; | ||
} | ||
self.store_stat.region_bytes_written.flush(); | ||
self.store_stat.region_keys_written.flush(); | ||
} | ||
|
||
fn on_update_store_flow(&mut self) { | ||
|
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.
@overvenus
Please update the crate.