-
Notifications
You must be signed in to change notification settings - Fork 235
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
:Issue 234: Split into reusable packages. #298
Conversation
It looks like you're using an editor or environment that is re-formatting all files with DOS carriage-return. Please update your environment settings and revert those changes. |
Just tried to fix the line endings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're our first Windows contributor in this repository 😄 sorry for all the things we are not handling properly in that case. Could you also rebase out the statsd_exporter.exe
and gitignore it?
Thank you so much for tackling this! The ~ files are making the diff tricky, I'm going to do another review pass when those are out. Could you also take a look at the failing tests? |
1a64e71
to
bb3927b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing the newlines! I'm quite happy with this already, only a few more comments on code organization.
The more I see them the more I think passing all the metrics individually is not viable. Let's make them fields on the relevant structs. I am wondering if there is a nice way to reduce the boilerplate for the caller without making packages mess with global state …
Working on all of this. Might take a bit of time... Busy! |
awesome, thank you for checking in! |
e43b0c3
to
4cf5455
Compare
Signed-off-by: Aykut Farsak <aykutfarsak@gmail.com> Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
Signed-off-by: Frank Davidson <frank_davidson@manulife.com> Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
Signed-off-by: Frank Davidson <davidfr@americas.manulife.net> Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
Signed-off-by: Frank Davidson <davidfr@americas.manulife.net> Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
Signed-off-by: Frank Davidson <davidfr@americas.manulife.net> Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
Signed-off-by: Frank Davidson <davidfr@americas.manulife.net> Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
Signed-off-by: Frank Davidson <davidfr@americas.manulife.net> Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
Signed-off-by: Frank Davidson <davidfr@americas.manulife.net> Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
b51efcb
to
dc6ba49
Compare
42f236c
to
72c05d2
Compare
I don't seem to be able to get the DCO check to work. Not sure what the issue is. |
I think it is taking issue with your author line:
something seems to be off with your gitconfig. |
Looks good! I want to merge this as is. We may iterate on the interfaces later; I'm not super happy with the amount of boilerplate around the metrics but also don't have a solution yet. When fixing the DCO, could you also squash all the commits into one so we don't end up with the .exe in the history? |
squash! Updated structs and tests. Updated structs and tests. Signed-off-by: Frank Davidson <davidfr@americas.manulife.net> Signed-off-by: Frank Davidson <ffdavidson@gmail.com> Signed-off-by: Frank Davidson <frank_davidson@manulife.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! I did some superficial acceptance testing and found that the unixgram listener crashes the program, but otherwise it seems to be working just as before. Once you add the listener.StatsDUnixgramListener
initialization it is ready to merge.
Signed-off-by: Frank Davidson <frank_davidson@manulife.com>
Thank you so much for getting this done! |
this deserves a call-out to surface any issues. Signed-off-by: Matthias Rampke <mr@soundcloud.com>
@matthiasr I think maybe I should pass line.LineToEvents() as a function value into the listener package, i.e., pass the LineToEvent function as an argument into listener.HandleConn() for use by event.EventHandler()? I don't think I can replace it as is now in the Graphite Exporter? What do you think? That would make LineToEvents pretty swappable for different use cases? |
That's a good idea, but does the listener have to know about events at all? I think we can disentangle the listener, event parsing, and collector even further. The listener package could only deal in "packages" (single lines or bundles of lines?), sending them through a channel to a parser goroutine (possibly multiple). The chain would roughly be listener -> (statsd / graphite / influxdb / ???) parser -> event queue -> collector. We already have a well defined interface from the parser to the event queue. What would be the best way to hand unparsed input to the parser? byte slices or strings? Single lines only, or whole packets? what would "a whole packet" mean in the context of TCP though? |
Signed-off-by: Frank Davidson frank_davidson@manulife.com
Hi,
I tried to deal with Issue #234. I don't have access to a StatsD server or anything (I'm actually working towards fixing the similar Graphite Exporter problem).
This passed all the tests. Let me know if there are things to fix here.
Thank you for all your hard work!
Frank