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

udp json listener #477

Closed
wants to merge 1 commit into from
Closed

udp json listener #477

wants to merge 1 commit into from

Conversation

schmurfy
Copy link
Contributor

(This is not ready to be merged as is)

I want something lighter than http for sending data to my influxdb and since my influxdb server and the producer are both on the same host I started with this simple listener which take UDP packets in with the standard json used for the http listener.

I want to know if this could be merged before working more on it (it may be simple but since I don't know much of go so it took me some time to even reach that point), it should works for simple use cases:

  • I don't care about lost packets (looks like this can still happen even on loopback interfaces if packets are sent too quickly)
  • packets misorder should not be an issue
  • I think there is no limit on datagram size on loopback interface but I cant' find any evidence of this, does anyone know ?

So far this works but there is no config part and I still need a way to tell in which series the data will be written (currently hardcoded).

So.. what do you think ? Could it be merged ? (if I add the missing part namely the config and a way to tell which serie to write to)

(This interface is only meant to write data, obviously)

@pauldix
Copy link
Member

pauldix commented Apr 28, 2014

I think having a UDP listener would be good. I think it should follow the same conventions as the graphite listener. Have the database configured through the config file, use an admin account to write data. And have the body of the UDP request be an array of objects (like the query responses) so you can post points to any time series.

With those updates we'd take it.

@schmurfy
Copy link
Contributor Author

ok I will complete it then.

do you know if there is limit on datagram size on the loopback interface ? That's not the first time I look for an answer to this question but never found a decent one xD
Since the network is bypassed I would imagine you can have the maximum UDP datagram size (65536 bytes) but no idea if this really works like that.

@pauldix
Copy link
Member

pauldix commented Apr 29, 2014

Not sure, but I think you can still go over that size and have it work.
You're just more likely to have stuff dropped.

On Tue, Apr 29, 2014 at 5:52 AM, Julien Ammous notifications@github.comwrote:

ok I will complete it then.

do you know if there is limit on datagram size on the loopback interface ?
That's not the first time I look for an answer to this question but never
found a decent one xD
Since the network is bypassed I would imagine you can have the maximum UDP
datagram size (65536 bytes) but no idea if this really works like that.


Reply to this email directly or view it on GitHubhttps://github.com//pull/477#issuecomment-41658585
.

@schmurfy
Copy link
Contributor Author

schmurfy commented May 1, 2014

here you go, I added the config part and rebased on master.
Everything is working for me, the json expected as input is the same you send to the http api endpoint.

@jvshahid jvshahid closed this in 8891329 May 1, 2014
@jvshahid
Copy link
Contributor

jvshahid commented May 1, 2014

@schmurfy the pr is merged. i added some tests and fixed the api to use the database from the configuration instead of hard coding it in api.go

@schmurfy
Copy link
Contributor Author

schmurfy commented May 2, 2014

great ! :)
After writing my first plugin I could confirm my initial thoughts: there is too much code going into the core files and I am pretty sure part of it could be moved into the plugin subfolder like the configuration, is that something you would merge if I manage to have something working ?

The idea is pretty simple: having as much as possible of the code related to a plugin in the plugin subfolder itself instead of lying around in core files.

@jvshahid
Copy link
Contributor

jvshahid commented May 2, 2014

Can you please define what do you mean by "core files", and what do you intend to change ? Probably github isn't the best place for this. Hit me up on irc or start a thread on the mailing list. I'll be happy to see more code reuse between the different api, if that's what you mean.

@schmurfy
Copy link
Contributor Author

schmurfy commented May 5, 2014

I will open a new thread on the mailing and try to be more explicit about what I mean, I already made an attempt previously but the thread did not get much traction. Now that I tried it I should be able to provide more precise ideas.

@schmurfy
Copy link
Contributor Author

schmurfy commented May 6, 2014

pauldix pushed a commit that referenced this pull request May 27, 2014
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.

None yet

3 participants