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

Change replay percentage to total block size processed #1289 #1335

Merged
merged 5 commits into from Oct 2, 2018

Conversation

Projects
3 participants
@cogutvalera
Member

cogutvalera commented Sep 19, 2018

PR for "Change replay percentage to total block size processed #1289"

@cogutvalera cogutvalera referenced this pull request Sep 19, 2018

Closed

Change replay percentage to total block size processed #1289

3 of 9 tasks complete
if( i % 10000 == 0 )
{
total_processed_block_size = _block_id_to_block.total_processed_block_size();
total_block_size = _block_id_to_block.total_block_size();

This comment has been minimized.

@pmconrad

pmconrad Sep 19, 2018

total_block_size doesn't change during replay, you should fetch that once before entering the loop.

@@ -271,4 +271,16 @@ optional<block_id_type> block_database::last_id()const
return optional<block_id_type>();
}
uint64_t block_database::total_processed_block_size()const

This comment has been minimized.

@pmconrad

pmconrad Sep 19, 2018

The name is misleading. The method returns the current position in the file. During replay, this is in fact what we interpret as total_processed_block_size, but during normal operation it isn't.

return (uint64_t)_blocks.tellg();
}
uint64_t block_database::total_block_size()const

This comment has been minimized.

@pmconrad

pmconrad Sep 19, 2018

Both these methods should return size_t.

@@ -271,4 +271,16 @@ optional<block_id_type> block_database::last_id()const
return optional<block_id_type>();
}
uint64_t block_database::total_processed_block_size()const
{
_blocks.seekg( 0, _blocks.cur );

This comment has been minimized.

@pmconrad

pmconrad Sep 19, 2018

I think this is superfluous.

@cogutvalera

This comment has been minimized.

Member

cogutvalera commented Sep 19, 2018

Thanks @pmconrad soon will push changes required.

@cogutvalera

This comment has been minimized.

Member

cogutvalera commented Sep 19, 2018

Pushed commit with required changes (just for the info)

total_processed_block_size = _block_id_to_block.blocks_current_position();
std::cerr << " "
<< double(total_processed_block_size*100) / total_block_size << "% "

This comment has been minimized.

@abitmore

abitmore Sep 19, 2018

Member

I guess this won't overflow? Still a bit uncomfortable with it.

By the way, perhaps better to show the block number as well?

@cogutvalera

This comment has been minimized.

Member

cogutvalera commented Sep 19, 2018

pushed new commit "added percents by num and fixed possible overflow"

@cogutvalera

This comment has been minimized.

Member

cogutvalera commented Sep 21, 2018

pushed new commit "added replay percents to the log" (see comment #985 (comment))

@cogutvalera cogutvalera referenced this pull request Sep 21, 2018

Closed

Log console output during replay to file #985

5 of 9 tasks complete
@pmconrad

Thanks!

@pmconrad

This comment has been minimized.

pmconrad commented Sep 24, 2018

I'd suggest to wait for bitshares/bitshares-fc#76, then bump fc before merging this one.

@cogutvalera

This comment has been minimized.

Member

cogutvalera commented Sep 28, 2018

@pmconrad Thanks !

@cogutvalera

This comment has been minimized.

Member

cogutvalera commented Oct 1, 2018

Can we merge this PR ?

@cogutvalera

This comment has been minimized.

Member

cogutvalera commented Oct 1, 2018

@abitmore abitmore added this to In progress in Feature release (201810) via automation Oct 1, 2018

@abitmore abitmore added this to the 201810 - Feature Release milestone Oct 1, 2018

@cogutvalera

This comment has been minimized.

Member

cogutvalera commented Oct 2, 2018

@pmconrad can we merge it too ?

Thanks !

@pmconrad pmconrad merged commit 49a7fb2 into bitshares:develop Oct 2, 2018

2 checks passed

ci/dockercloud Your tests passed in Docker Cloud
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

Feature release (201810) automation moved this from In progress to Done Oct 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment