Skip to content

feat: replace tcptrace with PyShark in TraceProcessor - #34

Merged
lordlabakdas merged 1 commit into
mainfrom
pyshark
Jun 6, 2026
Merged

lordlabakdas merged 1 commit into
mainfrom
pyshark

Conversation

@lordlabakdas

Copy link
Copy Markdown
Owner

tcptrace is unmaintained. Replace the subprocess shell-out with pyshark.FileCapture, which wraps Wireshark's actively-maintained dissectors and exposes tcp.analysis.ack_rtt, tcp.analysis.retransmission, and per-stream packet grouping natively in Python.

_FlowAccumulator tracks tx_packets, unique_bytes, rexmt_packets, timestamps, and RTT samples per flow direction. _dominant_flow() picks the flow with the most unique bytes. The 12-element metrics list is preserved unchanged for downstream compatibility.

Update test_trace.py: replace exe_comm mocks with SimpleNamespace fake packets and pyshark.FileCapture mocks. Add _FlowAccumulator unit tests. 56 tests, 99% coverage.

tcptrace is unmaintained. Replace the subprocess shell-out with
pyshark.FileCapture, which wraps Wireshark's actively-maintained
dissectors and exposes tcp.analysis.ack_rtt, tcp.analysis.retransmission,
and per-stream packet grouping natively in Python.

_FlowAccumulator tracks tx_packets, unique_bytes, rexmt_packets,
timestamps, and RTT samples per flow direction. _dominant_flow()
picks the flow with the most unique bytes. The 12-element metrics
list is preserved unchanged for downstream compatibility.

Update test_trace.py: replace exe_comm mocks with SimpleNamespace
fake packets and pyshark.FileCapture mocks. Add _FlowAccumulator
unit tests. 56 tests, 99% coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lordlabakdas
lordlabakdas merged commit 5dc2c40 into main Jun 6, 2026
6 of 7 checks passed
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.

1 participant