Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Add support for messagepack #734

Merged
merged 4 commits into from
Dec 5, 2019
Merged

Add support for messagepack #734

merged 4 commits into from
Dec 5, 2019

Conversation

lovasoa
Copy link
Contributor

@lovasoa lovasoa commented Jul 10, 2019

Description

This pull request implements fetching data from InfluxDB using msgpack serialization instead of JSON. This fixes issues related to serialization ambiguities in JSON, and makes database queries faster. It does not break compatibility with older influxdb versions that do not support msgpack.

Related issues

Closes #733
Fixes #665
Fixes #715
Fixes #625

Performance

Here is a performance comparison before (JSON) and after (msgpack) this pull request, for a simple SELECT * request on a measurement with 2 tags and three fields of types: integer, float and string:

performance comparison

Using msgpack gives a ~25% speedup.

requirements.txt Outdated Show resolved Hide resolved
influxdb/client.py Outdated Show resolved Hide resolved
@lovasoa
Copy link
Contributor Author

lovasoa commented Jul 12, 2019

@aviau Is it ok now ?

@lovasoa
Copy link
Contributor Author

lovasoa commented Jul 22, 2019

@aviau I think this is ready for merging.

@aviau
Copy link
Collaborator

aviau commented Jul 22, 2019

I will look at this as soon as I have time, thanks!

@lovasoa
Copy link
Contributor Author

lovasoa commented Jul 30, 2019

@aviau : Did you have the time to look at it ?

@lovasoa
Copy link
Contributor Author

lovasoa commented Oct 9, 2019

Can someone please review that ?

@lovasoa
Copy link
Contributor Author

lovasoa commented Nov 1, 2019

@aviau Can you find a few minutes to review that and merge it if it's ok ?

@lovasoa lovasoa requested a review from aviau November 4, 2019 18:12
@tgree
Copy link

tgree commented Nov 16, 2019

For the love of god someone please check this in!

@lovasoa lovasoa mentioned this pull request Nov 21, 2019
@lovasoa
Copy link
Contributor Author

lovasoa commented Nov 21, 2019

@xginn8: Maybe you can review this ?

@lovasoa
Copy link
Contributor Author

lovasoa commented Dec 5, 2019

What shall I do to have this reviewed ? This is a PR that gives a 25% speedup to the library and fixes multiple issues, and no one seems to be interested.

@russorat maybe ?

@russorat
Copy link
Contributor

russorat commented Dec 5, 2019

@lovasoa oh wow, this is awesome. Sorry for taking so long here. I'll find someone to review this. While I do that, could you sign the CLA agreement https://influxdata.com/community/cla/ ?

Copy link
Contributor

@sebito91 sebito91 left a comment

Choose a reason for hiding this comment

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

This looks great, thank you very much for your contribution!

@sebito91 sebito91 merged commit 3a5e621 into influxdata:master Dec 5, 2019
@lovasoa
Copy link
Contributor Author

lovasoa commented Dec 5, 2019

Hooray ! Thank you.

@sebito91
Copy link
Contributor

sebito91 commented Dec 5, 2019

So sorry for the delay @lovasoa, but we REALLY appreciate your contribution here. I'm going to look around at some other PRs and build up a release candidate shortly.

@lovasoa
Copy link
Contributor Author

lovasoa commented Jan 21, 2020

When do you think you can make a new release with that code ?

@sebito91
Copy link
Contributor

I know I've kicked the can a few times, but let's target this week for a release. Will get this sorted.

ocworld pushed a commit to ocworld/influxdb-python that referenced this pull request Feb 7, 2020
* Add support for messagepack

* Remove unnecessary blank line

Fixes https://github.com/influxdata/influxdb-python/pull/734/files/57daf8ccd5027c796a2fd3934b8e88d3982d300e#r302769403

* Small code reorganization

* Small code reorganization

Fixes influxdata#734 (comment)
@prometheanfire
Copy link
Contributor

the hard lock on 0.6.1 prevents this from being integrated with other solutions.

@lovasoa
Copy link
Contributor Author

lovasoa commented Apr 11, 2020

Oh yes, the dependency requirement should be updated. @prometheanfire, you should make a pull request. But good luck for getting it merged: mine took 5 months before someone finally looked at it.

@prometheanfire
Copy link
Contributor

ya, that seems to be common for oneliners. The amount of time it takes to merge is inversely proportional to the size of the patch.

@lovasoa
Copy link
Contributor Author

lovasoa commented Apr 11, 2020

Mine (#734) wasn't a one-liner, although it wasn't huge either.

image

@prometheanfire
Copy link
Contributor

true, I've had the same issue with pins or capping with others though (salt and boto off the top of my head).

bitoffdev added a commit to bitoffdev/influxdb-python that referenced this pull request Aug 22, 2020
- Update the work of PR influxdata#734 to correctly interpret negative timestamps
bitoffdev added a commit to bitoffdev/influxdb-python that referenced this pull request Aug 22, 2020
- Update the work of PR influxdata#734 to correctly interpret negative timestamps
- Update unit test for pre-unix epoch date with negative timestamp
return self._read_chunked_response(response)

data = response.json()
data = response._msgpack
Copy link
Contributor

Choose a reason for hiding this comment

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

is msgpack meant to ignore chunked answers?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
8 participants