This repository was archived by the owner on Sep 19, 2024. It is now read-only.
Add ability to aggregate packets for sending#60
Open
jjofseattle wants to merge 3 commits intosivy:masterfrom
Open
Add ability to aggregate packets for sending#60jjofseattle wants to merge 3 commits intosivy:masterfrom
jjofseattle wants to merge 3 commits intosivy:masterfrom
Conversation
|
g2g |
There was a problem hiding this comment.
Wouldn't it be better to have an array and loop on each entry on flush? I don't really the like the string thing with new lines... here's an example with a PHP implementation: https://github.com/beberlei/metrics/blob/master/src/Beberlei/Metrics/Collector/StatsD.php#L95-L107
Author
There was a problem hiding this comment.
That would defeat the purpose. We aggregate packets here to reduce the number of calls to socket.send, which is an expensive call.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This ports the functionality from https://github.com/msiebuhr/node-statsd-client for aggregated packets.
It shows great performance improvement. I ran perfTest/test.js to measure the time required of sending out 100,000 packets. A buffer size of 1200 is 5 times faster than no buffering.
==> node test.js 0
2143
2126
2186
2281
2487
1941
3006
2026
2909
2042
2049
^C
==> node test.js 1200
395
389
385
388
393
389
390
388
389
391
388
389
^C
==> node test.js 200
757
794
763
814
772
799
782
779
785
815
^C