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

nix the string interpolation on the hardware query in the aggregation mixin #20146

Merged
merged 1 commit into from
May 14, 2020

Conversation

d-m-u
Copy link
Contributor

@d-m-u d-m-u commented May 8, 2020

It's just a minor cleanup from #20132 cause I was silly and didn't catch it the first time.

Or rather it was. I'm stealing a lot of this now from master...kbrock:virtual_aggregates_ems

thanks Keenan

@d-m-u d-m-u changed the title nix the string interpolation nix the string interpolation on the hardware query in the aggregation mixin May 8, 2020
@Fryguy
Copy link
Member

Fryguy commented May 8, 2020

LGTM... super minor, but since there's no changes in the value of from from when it's declared, it might be cleaner to move the .to_sym earlier to the declaration....

from      = from.to_s.singularize.to_sym
...
hdws      = Hardware.where(from => targets).select(select)

@Fryguy Fryguy added the cleanup label May 8, 2020
@Fryguy Fryguy self-assigned this May 8, 2020
@d-m-u d-m-u force-pushed the cleanup_the_hardware_query branch from 119ee3e to ba56cfa Compare May 8, 2020 01:59
Fryguy
Fryguy previously approved these changes May 8, 2020
@d-m-u
Copy link
Contributor Author

d-m-u commented May 8, 2020

@miq-bot add_label jansa/yes?
it should be, i would hope, since #20132 was

Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together.

You may want to check out master...kbrock:virtual_aggregates_ems

ugh. that was 7 months ago... (too many ideas :( )

leave the inject in there for now, but maybe the other optimizations may treat you well.

Also, could you just do a quick check that this method is even called from tests.
Maybe put in a raise statement or something?

thnx

app/models/mixins/aggregation_mixin/methods.rb Outdated Show resolved Hide resolved
app/models/mixins/aggregation_mixin/methods.rb Outdated Show resolved Hide resolved
@kbrock
Copy link
Member

kbrock commented May 8, 2020

aside: that branch I pointed to does all metrics in 1 query bringing back only 1 number.
the reason I haven't pushed harder is I'm concerned about number overflows - especially with fields that return memory/disk space in bytes. (can't remember exactly which one was a number but it went over, thanks to NickL on finding that one.)

@d-m-u d-m-u changed the title nix the string interpolation on the hardware query in the aggregation mixin [wip] nix the string interpolation on the hardware query in the aggregation mixin May 8, 2020
@miq-bot miq-bot added the wip label May 8, 2020
@d-m-u d-m-u force-pushed the cleanup_the_hardware_query branch from ba56cfa to 727f637 Compare May 8, 2020 11:24
@d-m-u d-m-u requested a review from gtanzillo as a code owner May 8, 2020 11:24
d-m-u added a commit to d-m-u/manageiq that referenced this pull request May 8, 2020
@d-m-u d-m-u force-pushed the cleanup_the_hardware_query branch from 727f637 to d7e0121 Compare May 8, 2020 11:33
d-m-u added a commit to d-m-u/manageiq that referenced this pull request May 8, 2020
@d-m-u d-m-u force-pushed the cleanup_the_hardware_query branch from d7e0121 to 7d51f60 Compare May 8, 2020 12:01
d-m-u added a commit to d-m-u/manageiq that referenced this pull request May 8, 2020
@d-m-u d-m-u force-pushed the cleanup_the_hardware_query branch from 7d51f60 to 1864591 Compare May 8, 2020 12:27
@Fryguy Fryguy dismissed their stale review May 8, 2020 12:35

Things changed

@Fryguy Fryguy assigned kbrock and unassigned Fryguy May 8, 2020
@d-m-u d-m-u force-pushed the cleanup_the_hardware_query branch 2 times, most recently from 3658d3e to 402c497 Compare May 8, 2020 12:51
@d-m-u
Copy link
Contributor Author

d-m-u commented May 8, 2020

haha, Things changed
... and probably not for the better

@d-m-u d-m-u changed the title [wip] nix the string interpolation on the hardware query in the aggregation mixin nix the string interpolation on the hardware query in the aggregation mixin May 8, 2020
@miq-bot miq-bot removed the wip label May 8, 2020
@d-m-u
Copy link
Contributor Author

d-m-u commented May 9, 2020

closing in favor of #12427

@d-m-u d-m-u closed this May 9, 2020
@kbrock
Copy link
Member

kbrock commented May 11, 2020

wait - no. Your pr doesn't go the whole way so i want to merge this instead of that. We still have an overflow issue with 12427 and we won't fix that any time soon

@d-m-u
Copy link
Contributor Author

d-m-u commented May 11, 2020

phoooey, it was a good try though

@d-m-u d-m-u reopened this May 11, 2020
Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. (but I helped a little here so it would be a problem if I though it was junk)

@d-m-u d-m-u force-pushed the cleanup_the_hardware_query branch from 402c497 to f7b20d5 Compare May 11, 2020 18:05
@d-m-u
Copy link
Contributor Author

d-m-u commented May 12, 2020

hey @Fryguy sorry but any chance I could get you to re-review this, please?

@d-m-u d-m-u force-pushed the cleanup_the_hardware_query branch from f7b20d5 to ab7cedd Compare May 12, 2020 18:23
thanks Keenan and Jason :)
@d-m-u d-m-u force-pushed the cleanup_the_hardware_query branch from ab7cedd to e342471 Compare May 12, 2020 18:26
@miq-bot
Copy link
Member

miq-bot commented May 12, 2020

Checked commit d-m-u@e342471 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint
3 files checked, 0 offenses detected
Everything looks fine. 🍪

@d-m-u
Copy link
Contributor Author

d-m-u commented May 13, 2020

please?

@kbrock kbrock added the core label May 14, 2020
@kbrock kbrock merged commit 9be2b9b into ManageIQ:master May 14, 2020
@d-m-u d-m-u deleted the cleanup_the_hardware_query branch May 14, 2020 02:06
simaishi pushed a commit that referenced this pull request May 18, 2020
nix the string interpolation on the hardware query in the aggregation mixin

(cherry picked from commit 9be2b9b)
@simaishi
Copy link
Contributor

Jansa backport details:

$ git log -1
commit b7a41372d8ff06296799301a247e9ea8f9926ced
Author: Keenan Brock <keenan@thebrocks.net>
Date:   Wed May 13 22:04:39 2020 -0400

    Merge pull request #20146 from d-m-u/cleanup_the_hardware_query

    nix the string interpolation on the hardware query in the aggregation mixin

    (cherry picked from commit 9be2b9bf65589d307d1ee246199ff488fedf8844)

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.

6 participants