Skip to content

Add metric extraction utility methods to Context#227

Open
danielkza wants to merge 1 commit into
masterfrom
context_metrics_methods
Open

Add metric extraction utility methods to Context#227
danielkza wants to merge 1 commit into
masterfrom
context_metrics_methods

Conversation

@danielkza

Copy link
Copy Markdown
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).

@danielkza danielkza force-pushed the context_metrics_methods branch from 60bc710 to 2d8f9c9 Compare July 27, 2016 22:46
end
end

def tree_metrics

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

end

def tree_native_metrics
native_metrics.values.flat_map do |metrics|

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@diegoamc

Copy link
Copy Markdown
Contributor

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

@rafamanzo

rafamanzo commented Jul 31, 2016

Copy link
Copy Markdown
Member

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

@danielkza

Copy link
Copy Markdown
Contributor Author

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

@rafamanzo

Copy link
Copy Markdown
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