Skip to content
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

Completion percentage is wrong when IDs don't start at 1 #131

Open
JasonBarnabe opened this issue Dec 14, 2015 · 2 comments
Open

Completion percentage is wrong when IDs don't start at 1 #131

JasonBarnabe opened this issue Dec 14, 2015 · 2 comments

Comments

@JasonBarnabe
Copy link

I have a large table that gets regularly archived, so the IDs don't start at 1. This makes the percentage complete LHM reports way off.

jasons-mbp:panda jason$ rake db:migrate
SESSION STORE: active_record_store
CACHE STORE: file_store
==  AuditedChanges: migrating =================================================
-- index_exists?(:audits, [:association_id, :association_type], {:name=>"association_index"})
   -> 0.0024s
I, [2015-12-14T09:43:14.193077 #6202]  INFO -- : Starting LHM run on table=lhmn_audits
I, [2015-12-14T09:43:14.195034 #6202]  INFO -- : Starting run of class=Lhm::Migrator
I, [2015-12-14T09:43:14.296403 #6202]  INFO -- : Starting run of class=Lhm::Entangler
I, [2015-12-14T09:43:14.392986 #6202]  INFO -- : Starting run of class=Lhm::Chunker
I, [2015-12-14T09:43:14.395018 #6202]  INFO -- : Starting run of class=Lhm::Throttler::Time
89.22% (332992893/373246177) completeI, [2015-12-14T09:43:16.593463 #6202]  INFO -- : Starting run of class=Lhm::Throttler::Time
89.23% (333032893/373246177) completeI, [2015-12-14T09:43:18.900360 #6202]  INFO -- : Starting run of class=Lhm::Throttler::Time
89.24% (333072893/373246177) completeI, [2015-12-14T09:43:21.189020 #6202]  INFO -- : Starting run of class=Lhm::Throttler::Time
89.25% (333112893/373246177) completeI, [2015-12-14T09:43:23.605645 #6202]  INFO -- : Starting run of class=Lhm::Throttler::Time

I realize that the percentage complete will not be perfect if there are missing IDs, but to make it closer to perfect, perhaps check what the first ID is in the table and calculate based on that rather than assuming 1?

@skorfmann
Copy link

Yep, we have the same issue on a table where the first id is 1_000_000_000

@arthurnn
Copy link
Contributor

arthurnn commented Feb 1, 2016

You can write your own reporter. I guess the percentage reporter is assuming ids that started with 1. Fell free to send a PR, with a fix for this.
Thanks

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

No branches or pull requests

3 participants