Skip to content

Separated PcapLiveDevice statistics update worker under its own class. #1785

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

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

Dimi1010
Copy link
Collaborator

The PR separates the logic related to the statistics update worker into its own subclass to improve readability.

The main changes include:

  • Moved PCapStats to be declared under internal namespace.
  • Added helper method getStatistics to PcapHandle that calls pcap_stats on the handle internally.
  • Added StatisticsUpdateWorker as a nested class under PcapLiveDevice to encapsulate a running statistics update worker thread.
  • Replaced member variables related to the statistics update worker with a std::unique_ptr<StatisticsUpdateWorker> member field, representing an active worker.

Copy link

codecov bot commented Apr 23, 2025

Codecov Report

Attention: Patch coverage is 84.84848% with 10 lines in your changes missing coverage. Please review.

Project coverage is 83.08%. Comparing base (f842ccb) to head (c8bd08f).

Files with missing lines Patch % Lines
Pcap++/src/PcapLiveDevice.cpp 86.95% 3 Missing and 3 partials ⚠️
Pcap++/src/PcapDevice.cpp 71.42% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1785      +/-   ##
==========================================
- Coverage   83.10%   83.08%   -0.02%     
==========================================
  Files         283      283              
  Lines       48937    48971      +34     
  Branches    10567    10563       -4     
==========================================
+ Hits        40668    40690      +22     
- Misses       7113     7141      +28     
+ Partials     1156     1140      -16     
Flag Coverage Δ
alpine320 75.05% <57.44%> (-0.04%) ⬇️
fedora42 75.16% <56.52%> (-0.05%) ⬇️
macos-13 80.58% <72.13%> (-0.03%) ⬇️
macos-14 80.58% <72.13%> (-0.03%) ⬇️
macos-15 80.56% <72.13%> (-0.03%) ⬇️
mingw32 70.66% <41.30%> (-0.13%) ⬇️
mingw64 70.60% <41.30%> (-0.15%) ⬇️
npcap 84.95% <80.39%> (-0.12%) ⬇️
rhel94 74.92% <57.44%> (-0.04%) ⬇️
ubuntu2004 58.53% <55.31%> (-0.05%) ⬇️
ubuntu2004-zstd 58.67% <55.31%> (-0.03%) ⬇️
ubuntu2204 74.84% <57.44%> (-0.07%) ⬇️
ubuntu2204-icpx 61.47% <60.00%> (-0.05%) ⬇️
ubuntu2404 75.12% <57.44%> (-0.04%) ⬇️
ubuntu2404-arm64 75.07% <57.44%> (-0.07%) ⬇️
unittest 83.08% <84.84%> (-0.02%) ⬇️
windows-2019 85.04% <80.39%> (-0.05%) ⬇️
windows-2022 85.07% <80.39%> (-0.05%) ⬇️
winpcap 85.22% <80.39%> (-0.04%) ⬇️
xdp 50.54% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dimi1010 Dimi1010 marked this pull request as ready for review April 23, 2025 11:35
@Dimi1010 Dimi1010 requested a review from seladb as a code owner April 23, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant