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

Allow grouping all measurements into on with multiple fields #72

Closed
wants to merge 9 commits into from

Conversation

mnp
Copy link
Contributor

@mnp mnp commented Aug 24, 2017

This an attempt at #71.

Our organization needs to group all the fields under one measurement and transmit them as one measurement. This alternate serialization can be had by instantiating GroupedInfluxDbHttpSender instead of InfluxDbHttpSender.

TODO: update unit tests to cover the new code.

Our organization needs to group all the fields under one measurement and transmit them as
one measurement.  This alternate serialization can be had by instantiating GroupedInfluxDbHttpSender
instead of InfluxDbHttpSender.

TODO: update unit tests to cover the new code.
@coveralls
Copy link

Coverage Status

Coverage decreased (-3.4%) to 78.502% when pulling c94bd3c on mnp:master into 887ce61 on iZettle:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 82.01% when pulling 6d28525 on mnp:master into 887ce61 on iZettle:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 82.305% when pulling 1586ca4 on mnp:master into 887ce61 on iZettle:master.

Copy link
Contributor

@alorlea alorlea left a comment

Choose a reason for hiding this comment

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

Hi @mnp, we had a look over your contribution and we really liked it!

Unfortunately, there are some small changes that we would like you to do before we merge this PR.

@mnp
Copy link
Contributor Author

mnp commented Sep 1, 2017

@alorlea Thanks for reviewing. I'm looking for you comments, but I must be daft however, because there's none under your "view changes" button, and the "see review" button leads back here. Were your comments saved?

final byte[] line = influxDbWriteObjectSerializer.getLineProtocolString(influxDbWriteObject).getBytes(UTF_8);
String linestr = this.groupedFields
? influxDbWriteObjectSerializer.getGroupedLineProtocolString(influxDbWriteObject,measurement)
: influxDbWriteObjectSerializer.getLineProtocolString(influxDbWriteObject);
Copy link
Contributor

Choose a reason for hiding this comment

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

As we already have a base abstract class, InfluxDbBaseSender.java it would be preferable to have each implementation to follow the SRP. As of now, this implementation has 2 underlying ways to function.

This logic should be part of the new GroupedInfluxDbHttpSender

@alorlea
Copy link
Contributor

alorlea commented Sep 4, 2017

@mnp Sorry, you are right, it seems that my comments where in a draft mode and forgot to submit.
Now you should be able to see it

@mnp
Copy link
Contributor Author

mnp commented Sep 6, 2017

@alorlea - Agreed with your suggestion. Pushed in 13ed8cb.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 81.209% when pulling 13ed8cb on mnp:master into 887ce61 on iZettle:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 81.699% when pulling fec66e6 on mnp:master into 887ce61 on iZettle:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.4%) to 83.333% when pulling 851f85b on mnp:master into 887ce61 on iZettle:master.

@alorlea
Copy link
Contributor

alorlea commented Sep 13, 2017

Hi @mnp thank you for your changes! This looks better. Anything to add @nzroller @fredrikbackstrom ?

@coveralls
Copy link

Coverage Status

Coverage increased (+1.5%) to 83.442% when pulling a258730 on mnp:master into 887ce61 on iZettle:master.

@mnp
Copy link
Contributor Author

mnp commented Sep 13, 2017

@alorlea Sorry for sneaking in another commit a258730 after you looked. We just found that this reporter was not behaving consistently with other reporters like the Graphite one, with respect to the codahale JVM gauge group reporting. If this feature is controversial I would understand wanting to make it configurable.

@alorlea
Copy link
Contributor

alorlea commented Sep 14, 2017

@mnp We checked over your commit, and we are fine with those changes.

It could be great if you could add a brief explanation of how to enable this in the README?

* Passthrough to ultimately select a different style of serializer: grouped fields on one influxdb protocol line,
* instead of one field per protocol line.
*/
public class GroupedInfluxDbHttpSender extends InfluxDbHttpSender {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you write a bit extensive docs here, especially document the assumptions and limitations. (For example how tags are working).

After that this is ready for merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Was on break, will do!

@rickard-von-essen-iz rickard-von-essen-iz changed the title Added option to the InfluxDB HTTP line protocol serializer. Allow grouping all measurements into on with multiple fields Oct 17, 2017
@mnp
Copy link
Contributor Author

mnp commented Jan 24, 2018 via email

@tmousaw-ptc
Copy link
Contributor

Where does this change sit? It appears that there needs to be more explanation of some of the code (as far as I can tell by the last comment). The person who initially made these changes has since left our company and I'd love to get this merged back into this library such that we don't have to have our own version of it.

@rickard-von-essen-iz
Copy link
Contributor

@tmousaw-ptc thanks for picking this up! I think we can merge this if you just add a short explanation how this works and a brief example of how to use it. See my #72 (comment) here.

@pp-tim
Copy link
Contributor

pp-tim commented Apr 7, 2020

Folded in via another PR #116

@pp-tim pp-tim closed this Apr 7, 2020
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.

6 participants