Skip to content

Graphite metrics coverage#491

Merged
pmouawad merged 10 commits into
apache:masterfrom
ham1:graphite-metrics-coverage
Sep 17, 2019
Merged

Graphite metrics coverage#491
pmouawad merged 10 commits into
apache:masterfrom
ham1:graphite-metrics-coverage

Conversation

@ham1
Copy link
Copy Markdown
Contributor

@ham1 ham1 commented Sep 15, 2019

Description

Added TextGraphiteMetricsSenderSpec to provide some coverage of TextGraphiteMetricsSender and PickleGraphiteMetricsSender and PickleGraphiteMetricsSenderSpec. Also cleaned up code in the surrounding area.

Motivation and Context

More tests!

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.

@ham1 ham1 force-pushed the graphite-metrics-coverage branch from 5fea03f to 7762594 Compare September 15, 2019 14:39
@ham1
Copy link
Copy Markdown
Contributor Author

ham1 commented Sep 15, 2019

I have some questions for everyone:

  1. I've removed the .clear() from the lists after sending because this didn't seem to be required as there will no longer be a reference to the list, therefore will be GC'd, this should also make sending slightly more efficient.
  2. I've added an overloaded setup method to TextGraphiteMetricsSender to enable testing, is there a better/preferred way? e.g. should it be protected or private or a new constructor?
  3. should destroy() also set metrics to null or are we relying on the original reference to be removed after destroy is called?

final String key = entry.getKey();
final SamplerMetric metric = entry.getValue();
if(key.equals(CUMULATED_METRICS)) {
getMetricsPerSampler().forEach((key, metric) -> {
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.

Did you check if use of lambda here would impact negatively performances ? (As per other PR discussion ?)

Thanks

@pmouawad
Copy link
Copy Markdown
Contributor

Hi @ham1 ,
Thanks for this very useful PR.
Except for the forEach note, I am ok with code.
Could you check and either keep previous form or keep it if lambda is not counter performant.

Thanks

@pmouawad pmouawad merged commit ac7d2b3 into apache:master Sep 17, 2019
@ham1 ham1 deleted the graphite-metrics-coverage branch September 19, 2019 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants