-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: master
Are you sure you want to change the base?
Conversation
60bc710
to
2d8f9c9
Compare
end | ||
end | ||
|
||
def tree_metrics |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Good refactoring! Congratulations! |
@@ -12,5 +12,15 @@ def initialize(params={}) | |||
end | |||
@compound_metrics = [] | |||
end | |||
|
|||
def tree_native_metrics | |||
native_metrics.values.flat_map do |metrics| |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Any other comments? When this is merge I can make the interpreting optimization PR. |
For me it's good to go. @mezuro/core ? |
Would you mind if I split this commit into smaller ones by Friday? |
Not at all. I can do it today if you tell me what you think should be split. |
I was thinking about:
What do you think? |
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).