-
Notifications
You must be signed in to change notification settings - Fork 10
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 progress logs during snapshot loading #395
Conversation
@@ -61,6 +61,7 @@ class snapshotted_tester : public base_tester { | |||
controller::config copied_config = (copy_files_from_config == copy_config_files) | |||
? copy_config_and_files(config, ordinal) : copy_config(config, ordinal); | |||
|
|||
BOOST_CHECK_GT(snapshot->total_row_count(), 0); |
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.
This is good enough to make sure all three impls of total_row_count()
are sane (and indeed I found my rapidjson impl was incorrect initially). I don't think we need to actually make sure the exact count is accurate and precise.
size_t count = 0; | ||
const size_t total = 0; | ||
time_t last_print = time(NULL); | ||
}; |
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.
It's a little tempting to move this completely inside of snapshot_reader so that maybe the onus to call progress()
remains entirely inside of the snapshot_reaader
& friends (which would probably help ensuring there isn't missed calls). But snapshot_reader
's interface technically allows you to read the same section multiple times (even though nobody does that..) so, eh.. not a perfect match.
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 could see a desire for a user to provide their own version of snapshot_loaded_row_counter
say for diff logging purposes. Keeping it external would make that easier. I don't think it worth making it a template or derivable type at this point until that is needed.
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 idea buuuutt.. this all probably needs to be refactored again when making loading parallel so that might not be possible. I didn't mention that this may be somewhat temporary since I'm not committing to parallel loading just yet..
size_t count = 0; | ||
const size_t total = 0; | ||
time_t last_print = time(NULL); | ||
}; |
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 could see a desire for a user to provide their own version of snapshot_loaded_row_counter
say for diff logging purposes. Keeping it external would make that easier. I don't think it worth making it a template or derivable type at this point until that is needed.
Note:start |
Adds progress logs during snapshot loading; can look something like
Resolves AntelopeIO/leap#1167