-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Exporting compaction stats in the form of a map #1477
Conversation
Summary: Currently the compaction stats are printed to stdout. We want to export the compaction stats in a map format so that the upper layer apps (e.g., MySQL) could present the stats in any format required by the them. Test Plan: An exiting unit test is augmented to also test the new export API: "./db_test2 --gtest_filter=*AutomaticCompactionOverlapManualCompaction"
@maysamyabandeh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@maysamyabandeh updated the pull request - view changes - changes since last import |
@maysamyabandeh updated the pull request - view changes - changes since last import |
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.
LGTM
? 0.0 | ||
: static_cast<double>(comp_stats_[level].bytes_written) / | ||
comp_stats_[level].bytes_read_non_output_levels; | ||
auto level_stats = std::map<LevelStatType, double>(); |
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.
Let's rewrite it this way
std::map<LevelStatType, double>() level_stats;
double w_amp = compaction_stats_sum->bytes_written / | ||
static_cast<double>(curr_ingest + 1); | ||
// Stats summary across levels | ||
auto level_stats = std::map<LevelStatType, double>(); |
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.
ditto
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.
Also what do you think about renaming this to sum_stats
since it's not actually a level stats
/** | ||
* Dump Compaction Level stats to a map of stat name to value in double. | ||
* The level in stat name is represented with a prefix "Lx" where "x" | ||
* is the level number. A special level "Sum" represnts the sum of a stat |
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.
nit:
represnts
=> represents
fir
=> for
@maysamyabandeh updated the pull request - view changes - changes since last import |
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.
Good Job!
Summary:
Currently the compaction stats are printed to stdout. We want to export the compaction stats in a map format so that the upper layer apps (e.g., MySQL) could present
the stats in any format required by the them.
Test Plan: An exiting unit test is augmented to also test the new export API: "./db_test2 --gtest_filter=*AutomaticCompactionOverlapManualCompaction"