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

Use parents from resource when there are not exist in MetricRollup #12164

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Oct 25, 2016

Select parents from resource when there are nils in MetricRollups records

In this PR #11648 we
introduced selecting rates according to first MetricRollup
record of group. We can do it because group of these records
belong to one resource.

Selection is based on
MetricRollup#parent_host or parent_ems_cluster or
parent_storage or parent_ems but sometimes this fields in
MetricRollup are nil and it produces empty cells on the
report - it is because proper rate was not selected.

Fix provides that we are selecting parents from
the resource direcly when there are not exists in
MetricRollup.

Screenshot of issue: MetricRollup#parent_storage was nil in May records.
before
screen shot 2016-10-25 at 15 22 36

after
screen shot 2016-10-25 at 15 19 41

@miq-bot add_label chargeback, bug, reporting
@miq-bot assign @gtanzillo

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

👍 LGTM

perf.parent_storage || perf.resource.storage,
perf.parent_ems || perf.resource.ext_management_system,
@enterprise,
perf.resource.try(:tenant)]
Copy link
Member

@isimluk isimluk Oct 26, 2016

Choose a reason for hiding this comment

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

Notes

  • This list is later passed to the method that finds applicable rate/s (in get_rates).
  • We cache rates (probably for performance reasons).
  • We need to update caching mechanism, when amending rate selection. -> please add resource_id into hash_features_affecting_rate

Another idea:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 comment

@lpichler lpichler changed the title Use parents from resource when there are not exist in MetricRollup [WIP] Use parents from resource when there are not exist in MetricRollup Oct 26, 2016
@lpichler
Copy link
Contributor Author

@miq-bot add_label wip

@miq-bot miq-bot added the wip label Oct 26, 2016
@lpichler lpichler force-pushed the select_parent_when_missing_in_metric_rollup branch from d72dd2b to 725878d Compare October 27, 2016 08:55
@lpichler lpichler changed the title [WIP] Use parents from resource when there are not exist in MetricRollup Use parents from resource when there are not exist in MetricRollup Oct 27, 2016
@lpichler
Copy link
Contributor Author

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Oct 27, 2016
@lpichler
Copy link
Contributor Author

After disscussion with @isimluk we realized that these changes should be done also for determination of key in the method

so before it I moved determination of resource parents (host, ems_cluster, storage and tenant) to the one method in first two commits and then I did described changes on the one place.

thanks @isimluk and please review

In this PR ManageIQ#11648 we
introduced selecting rates according to first MetricRollup
record of group. We can do it because group of these records
belong to one resource.

Selection is based on
MetricRollup#parent_host or parent_ems_cluster or
parent_storage or parent_ems but sometimes this fields in
MetricRollup are nil and it produces empty cells on the
report - it is because proper rate was not selected.

Fix provides that we are selecting parents from
the resource direcly when there are not exists in
MetricRollup.
@lpichler lpichler force-pushed the select_parent_when_missing_in_metric_rollup branch from 725878d to 4e2086a Compare October 27, 2016 11:37
@miq-bot
Copy link
Member

miq-bot commented Oct 27, 2016

Checked commits lpichler/manageiq@3f48492~...4e2086a with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
5 files checked, 0 offenses detected
Everything looks good. 👍


expect(parents).to match_array(expected_array)
end
end
Copy link
Member

Choose a reason for hiding this comment

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

Woot! 🌳

parent_ems || resource.try(:ext_management_system),
resource.try(:tenant)
].compact
end
Copy link
Member

Choose a reason for hiding this comment

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

👍

@isimluk
Copy link
Member

isimluk commented Nov 1, 2016

@gtanzillo I think this is step in the right direction.

@isimluk
Copy link
Member

isimluk commented Nov 1, 2016

The question remains, why the metric rollup records without values had existed.

@gtanzillo gtanzillo added this to the Sprint 49 Ending Nov 14, 2016 milestone Nov 1, 2016
@gtanzillo gtanzillo merged commit 7061718 into ManageIQ:master Nov 1, 2016
chessbyte pushed a commit that referenced this pull request Nov 1, 2016
…_metric_rollup

Use parents from resource when there are not exist in MetricRollup
(cherry picked from commit 7061718)
@chessbyte
Copy link
Member

Euwe Backport details:

$ git log -1
commit 9910726a39da3ebd18159b90f3a10998f74e71d6
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Tue Nov 1 09:08:04 2016 -0400

    Merge pull request #12164 from lpichler/select_parent_when_missing_in_metric_rollup

    Use parents from resource when there are not exist in MetricRollup
    (cherry picked from commit 70617181fdcfa9ba625dcef95989d3a48a182f32)

@lpichler lpichler deleted the select_parent_when_missing_in_metric_rollup branch March 3, 2017 09:41
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