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

InfluxDB output plugin should sort tags #3452

Closed
stuartcarnie opened this issue Nov 9, 2017 · 1 comment · Fixed by #3924
Closed

InfluxDB output plugin should sort tags #3452

stuartcarnie opened this issue Nov 9, 2017 · 1 comment · Fixed by #3924
Assignees
Milestone

Comments

@stuartcarnie
Copy link

stuartcarnie commented Nov 9, 2017

Sending unsorted tags to InfluxDB generates additional work, including allocating a new slice for each point that is parsed and subsequently sorting the tag key / values.

Benchmarks for parsing 5000 points with 10 sorted vs unsorted tags:

± go test -bench=_5000 -run=- ./models
goos: darwin
goarch: amd64
pkg: github.com/influxdata/influxdb/models
BenchmarkParsePointsTagsUnsorted10_5000-8   	     100	  10185633 ns/op	  70.69 MB/s	 1921936 B/op	   10001 allocs/op
BenchmarkParsePointsTagsSorted10_5000-8     	     200	   6268681 ns/op	 114.86 MB/s	 1281920 B/op	    5001 allocs/op
@oplehto
Copy link
Contributor

oplehto commented Jan 9, 2018

+1
We perform some filtering and routing of the line protocol data using regexp-based rules while en route to InfluxDB. Having a guaranteed ordering of the tags would make it much simpler and less costly to create rules based on multiple tags.

Edit: This would also make it a bit easier to debug the line protocol with shell tools as the columns would line up nicely for a specific measurement (provided that the set of tag keys is identical for each point).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants