-
Notifications
You must be signed in to change notification settings - Fork 2.2k
chore(statsd sink): refactor statsd sink to stream-based style
#16199
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
db9f4ca
wip commit
tobz e5280d9
wip
tobz a22763e
massive rework
tobz 0ab950b
Merge branch 'master' into tobz/rewrite-statsd-sink
tobz bacf1ff
add example metadata
tobz a17e839
port doc examples + keepalive for TCP
tobz 8609e9f
Merge branch 'master' into tobz/rewrite-statsd-sink
tobz a08bc84
start refactoring based on PR feedback
tobz b32e933
Merge branch 'master' into tobz/rewrite-statsd-sink
tobz 6037898
lot o cleanup
tobz f28379f
Merge branch 'master' into tobz/rewrite-statsd-sink
tobz cd9fe58
start futzing with an opaque wrapper for tcp/udp/udx
tobz 8c1dd18
more
tobz 36f5627
Merge branch 'master' into tobz/rewrite-statsd-sink
tobz 577efa9
a bunch of rework to simplify the newer stuff
tobz f67a09e
revert unrelated changes to DD metrics sink
tobz f0f531b
fix tests + make encoding more efficient
tobz 667ce41
clippy lint + trying to sort of socket2 stuff for cross-platform
tobz 2144849
upgrade to tokio 1.27.0 + cleanup socket asfd/asrawfd stuff
tobz 78e633b
Merge branch 'master' into tobz/rewrite-statsd-sink
tobz fe9a495
always include the unix related internal events
tobz 392c4d7
fix booboos
tobz fce04a2
make generated docs line up
tobz 332dff2
sighhhh
tobz 7664aa7
bring in TLS support for TCP service
tobz 35cde29
Merge branch 'master' into tobz/rewrite-statsd-sink
tobz 292b171
set a default unix mode to avoid breaking change with addition of uni…
tobz 1373f1e
Merge branch 'master' into tobz/rewrite-statsd-sink
tobz 74d9bff
consolidate hostandport desc + remove unused UdpService
tobz f6d7292
some PR cleanup
tobz be7c5ef
fix fmt
tobz d35bcf4
fix handling of encoding request splits + add more accurate batch siz…
tobz 43b3c3e
add missing file
tobz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| use std::{io, os::fd::AsRawFd, time::Duration}; | ||
|
|
||
| use socket2::{SockRef, TcpKeepalive}; | ||
| use tokio::net::TcpStream; | ||
|
|
||
| /// Sets the receive buffer size for a socket. | ||
| /// | ||
| /// This is the equivalent of setting the `SO_RCVBUF` socket setting directly. | ||
| /// | ||
| /// # Errors | ||
| /// | ||
| /// If there is an error setting the receive buffer size on the given socket, or if the value given | ||
| /// as the socket is not a valid socket, an error variant will be returned explaining the underlying | ||
| /// I/O error. | ||
| pub fn set_receive_buffer_size<S>(socket: &S, size: usize) -> io::Result<()> | ||
| where | ||
| S: AsRawFd, | ||
| { | ||
| SockRef::from(socket).set_recv_buffer_size(size) | ||
| } | ||
|
|
||
| /// Sets the send buffer size for a socket. | ||
| /// | ||
| /// This is the equivalent of setting the `SO_SNDBUF` socket setting directly. | ||
| /// | ||
| /// # Errors | ||
| /// | ||
| /// If there is an error setting the send buffer size on the given socket, or if the value given | ||
| /// as the socket is not a valid socket, an error variant will be returned explaining the underlying | ||
| /// I/O error. | ||
| pub fn set_send_buffer_size<S>(socket: &S, size: usize) -> io::Result<()> | ||
| where | ||
| S: AsRawFd, | ||
| { | ||
| SockRef::from(socket).set_send_buffer_size(size) | ||
| } | ||
|
|
||
| /// Sets the TCP keepalive behavior on a socket. | ||
| /// | ||
| /// This is the equivalent of setting the `SO_KEEPALIVE` and `TCP_KEEPALIVE` socket settings | ||
| /// directly. | ||
| /// | ||
| /// # Errors | ||
| /// | ||
| /// If there is an error with either enabling keepalive probes or setting the TCP keepalive idle | ||
| /// timeout on the given socket, an error variant will be returned explaining the underlying I/O | ||
| /// error. | ||
| pub fn set_keepalive(socket: &TcpStream, ttl: Duration) -> io::Result<()> { | ||
| SockRef::from(socket).set_tcp_keepalive(&TcpKeepalive::new().with_time(ttl)) | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.