-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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 time measuring metrics for file ingestion in PerfContext #13219
Open
jowlyzhang
wants to merge
1
commit into
facebook:main
Choose a base branch
from
jowlyzhang:ingestion_time
base: main
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.
+79
−12
Open
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,19 +14,39 @@ | |
namespace ROCKSDB_NAMESPACE { | ||
|
||
// How much perf stats to collect. Affects perf_context and iostats_context. | ||
// These levels are incremental, which means a new set of metrics will get | ||
// collected when PerfLevel is upgraded from level n to level n + 1. | ||
// Each level's documentation specifies the incremental set of metrics it | ||
// enables. As an example, kEnableWait will also enable collecting all the | ||
// metrics that kEnableCount enables, and its documentation only specifies which | ||
// extra metrics it also enables. | ||
// | ||
// These metrics are identified with some naming conventions, but not all | ||
// metrics follow exactly this convention. The metrics' own documentation should | ||
// be source of truth if they diverge. | ||
enum PerfLevel : unsigned char { | ||
kUninitialized = 0, // unknown setting | ||
kDisable = 1, // disable perf stats | ||
kEnableCount = 2, // enable only count stats | ||
kEnableWait = 3, // measure time spent by user threads | ||
// blocked in RocksDB, and not external | ||
// resources such as mutexes and IO | ||
kEnableTimeExceptForMutex = 4, // Other than count stats, also enable time | ||
// stats except for mutexes | ||
// Other than time, also measure CPU time counters. Still don't measure | ||
// time (neither wall time nor CPU time) for mutexes. | ||
// Unknown setting | ||
kUninitialized = 0, | ||
// Disable perf stats | ||
kDisable = 1, | ||
// Starts enabling count metrics. These metrics usually don't have time | ||
// related keywords, and are likely to have keywords like "count" or "byte". | ||
kEnableCount = 2, | ||
// Starts enabling metrics that measure time spent by user threads blocked in | ||
// RocksDB waiting for RocksDB to take actions, as opposed to waiting for | ||
// external resources such as mutexes and IO. | ||
// These metrics usually have this pattern: "_[wait|delay]_*_[time|nanos]". | ||
kEnableWait = 3, | ||
// Starts enabling metrics that measure the end to end time of an operation. | ||
// These metrics' names have keywords "time" or "nanos". Check other time | ||
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. nit: "time" or time unit e.g, nanos, micros. |
||
// measuring metrics with similar but more specific naming conventions. | ||
kEnableTimeExceptForMutex = 4, | ||
// Starts enabling metrics that measure the cpu time of an operation. These | ||
// metrics' name usually this pattern "_cpu_*_[time|nanos]". | ||
kEnableTimeAndCPUTimeExceptForMutex = 5, | ||
kEnableTime = 6, // enable count and time stats | ||
// Starts enabling metrics that measure time for mutex. These metrics' name | ||
// usually have this pattern: "_[mutex|condition]_*_[time|nanos]". | ||
kEnableTime = 6, | ||
kOutOfBounds = 7 // N.B. Must always be the last value! | ||
}; | ||
|
||
|
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
1 change: 1 addition & 0 deletions
1
unreleased_history/public_api_changes/ingestion_time_in_perf_context.md
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 @@ | ||
Add `file_ingestion_nanos` and `file_ingestion_blocking_live_writes_nanos` in PerfContext to observe file ingestions |
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.
I assumed your test ensure blocking live writes will happen so this proves your point.