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

Do not run these seeds twice #14726

Merged
merged 3 commits into from
Apr 12, 2017
Merged

Conversation

isimluk
Copy link
Member

@isimluk isimluk commented Apr 11, 2017

We run seeds on every start-up. Certain methods were called twice. That is not efficient.

On my system, running 100.times { MiqWidget.seed } gives:

ms bytes objects queries query (ms) % comments
55,532.4 89,772,866* 61,866,274 31,300 13,085.5 100% before
9,343.4 7,196,824* 8,821,284 6,300 2,181.3 16% after

isimluk added 3 commits April 11, 2017 15:08
MiqReport is PRIMORDIAL. It is guaranteed to be already present.
Both the MiqWidget and RssFeed are part of EvmDatabase::ORDERED_CLASSES.
The RssFeed.sync is guaranteed to be run first.
It is guaranteed to be run anyway.
@isimluk isimluk force-pushed the speed-up-miq-widget-seed branch from 792b36e to 3bc2be6 Compare April 11, 2017 13:10
@miq-bot
Copy link
Member

miq-bot commented Apr 11, 2017

Checked commits isimluk/manageiq@49c07af~...3bc2be6 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks good. 👍

@kbrock
Copy link
Member

kbrock commented Apr 11, 2017

Is there a way we can define these dependencies somewhere?

the dependencies will be hidden in our ordered list and if we want to remove primordial seeds, we won't be able to.

@Fryguy do you like just having comments in the seed ordering?

@Fryguy
Copy link
Member

Fryguy commented Apr 11, 2017

We could just hardcode the list right in the initial seeding if you want. I don't think we have to be super dynamic about seeding.

@kbrock kbrock merged commit 7b3b074 into ManageIQ:master Apr 12, 2017
@kbrock kbrock added this to the Sprint 59 Ending Apr 24, 2017 milestone Apr 12, 2017
@isimluk isimluk added fine/yes and removed fine/no labels Apr 13, 2017
simaishi pushed a commit that referenced this pull request Apr 13, 2017
Do not run these seeds twice
(cherry picked from commit 7b3b074)
@simaishi
Copy link
Contributor

Fine backport details:

$ git log -1
commit 7f18259d994d447ac32cbf6054c4d2aedfc917b2
Author: Keenan Brock <[email protected]>
Date:   Wed Apr 12 14:33:17 2017 -0400

    Merge pull request #14726 from isimluk/speed-up-miq-widget-seed
    
    Do not run these seeds twice
    (cherry picked from commit 7b3b074faa37fd13c408a24efbead79a21248b16)

@isimluk isimluk deleted the speed-up-miq-widget-seed branch April 24, 2017 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants