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

Add metric extraction utility methods to Context #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielkza
Copy link
Contributor

Code for selecting some metrics among those stored in a context was repeated in multiple places. Extract it to methods in preparation for the interpreting processing step rewrite (can also be incorporated to the aggregation rewrite in #225).

end
end

def tree_metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are we using this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not used right now but it will be used immediately when I make the PR for the interpreting rewrite.

@diegoamc
Copy link
Contributor

Good refactoring! Congratulations!
Apart from my only comment everything looks fine.

@@ -12,5 +12,15 @@ def initialize(params={})
end
@compound_metrics = []
end

def tree_native_metrics
native_metrics.values.flat_map do |metrics|
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think an ||= would help here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's necessary since this method should not be a performance problem at all: we never have more than 2 digits of metrics.

@danielkza
Copy link
Contributor Author

Any other comments? When this is merge I can make the interpreting optimization PR.

@diegoamc
Copy link
Contributor

For me it's good to go. @mezuro/core ?

@rafamanzo
Copy link
Member

rafamanzo commented Jul 31, 2016

Would you mind if I split this commit into smaller ones by Friday?

@danielkza
Copy link
Contributor Author

Not at all. I can do it today if you tell me what you think should be split.

@rafamanzo
Copy link
Member

I was thinking about:

  • New Context methods
  • Refactor Aggregator
  • Refactor MetricResultsChecker

What do you think?

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.

3 participants