Measure latency on connections that were already established - #38
Closed
git-hulk wants to merge 1 commit into
Closed
Measure latency on connections that were already established#38git-hulk wants to merge 1 commit into
git-hulk wants to merge 1 commit into
Conversation
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 11:45
060ee91 to
4395653
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 11:45
6112af8 to
2f40818
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 11:46
4395653 to
6682099
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 11:46
2f40818 to
b2ab59e
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 11:47
6682099 to
0f230db
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 11:47
b2ab59e to
86e90ef
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 11:58
0f230db to
3f08850
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 11:58
86e90ef to
429a565
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:15
3f08850 to
32e3312
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:15
429a565 to
72fa0d8
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:24
32e3312 to
6aa59a2
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:24
72fa0d8 to
21a0828
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:26
6aa59a2 to
46b92a5
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:26
21a0828 to
da92808
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:27
46b92a5 to
71b9cef
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:27
da92808 to
1c27aee
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:28
71b9cef to
e97f1ea
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:28
1c27aee to
b3b0c72
Compare
git-hulk
force-pushed
the
design-single-pcap-handle
branch
from
September 2, 2026 12:31
e97f1ea to
d2a9484
Compare
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:31
b3b0c72 to
8584a14
Compare
The server side of a connection was only ever learned from a captured SYN, so a connection that existed before tcpkit started was invisible: packet_direction returned -1 for every one of its packets and they were dropped without being counted. That is the normal case for the tool's own documented use, since redis and memcached clients hold pooled connections open for the life of the process -- `tcpkit -i eth0 tcp port 6379 -p redis` against a busy server could sit there printing nothing at all until a client happened to reconnect. When neither end of a data-carrying packet is a known endpoint, take the lower of the two ports to be the service: clients draw from the ephemeral range above it. Unlike guessing from the direction of the first packet, that holds whether a request or a response is seen first, which matters because a capture starts mid-conversation. A captured handshake still wins, and the guess is only made once per endpoint. Replaying a capture with no handshake, whose first frame is a response to a request that was never captured, went from no output to correctly reporting the following request against 10.0.0.2:6379. Assistant By Opus 5 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
git-hulk
force-pushed
the
design-established-connections
branch
from
September 2, 2026 12:34
8584a14 to
9406c9a
Compare
Owner
Author
|
Dropping this one without merging, at the author's request. It added the fallback that guesses which side of a connection is the server when no TCP handshake was captured, so that latency is still reported for connections that were already established when tcpkit started. PR #39 was stacked on top of this and has been rebased onto master, so it no longer carries this commit and can be reviewed on its own. Nothing merged to master depends on this change. The |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The server side of a connection was only ever learned from a captured
SYN, so a connection that existed before tcpkit started was invisible:
packet_direction returned -1 for every one of its packets and they were
dropped without being counted. That is the normal case for the tool's
own documented use, since redis and memcached clients hold pooled
connections open for the life of the process --
tcpkit -i eth0 tcp port 6379 -p redisagainst a busy server could sit there printingnothing at all until a client happened to reconnect.
When neither end of a data-carrying packet is a known endpoint, take
the lower of the two ports to be the service: clients draw from the
ephemeral range above it. Unlike guessing from the direction of the
first packet, that holds whether a request or a response is seen first,
which matters because a capture starts mid-conversation. A captured
handshake still wins, and the guess is only made once per endpoint.
Replaying a capture with no handshake, whose first frame is a response
to a request that was never captured, went from no output to correctly
reporting the following request against 10.0.0.2:6379.
🤖 Generated with Claude Code