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

Graphite metrics coverage #491

Merged
merged 10 commits into from Sep 17, 2019

Conversation

@ham1
Copy link
Contributor

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 ham1:graphite-metrics-coverage branch from 5fea03f to 7762594 Sep 15, 2019
@ham1

This comment has been minimized.

Copy link
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) -> {

This comment has been minimized.

Copy link
@pmouawad

pmouawad Sep 16, 2019

Contributor

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

Thanks

@pmouawad

This comment has been minimized.

Copy link
Contributor

pmouawad commented Sep 16, 2019

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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ham1 ham1 deleted the ham1:graphite-metrics-coverage branch Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.