Skip to content
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

Overhaul stats events: merge UDP core events with a different IP version #1381

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Mar 17, 2025

Change events from this:

bittorrent_udp_tracker_core::statistics::event::Event:

pub enum Event {
    Udp4Connect,
    Udp4Announce,
    Udp4Scrape,
    Udp6Connect,
    Udp6Announce,
    Udp6Scrape,
}

To this:

pub enum Event {
    UdpConnect { context: ConnectionContext },
    UdpAnnounce { context: ConnectionContext },
    UdpScrape { context: ConnectionContext },
}

pub struct ConnectionContext {
    client_socket_addr: SocketAddr,
    server_socket_addr: SocketAddr,
}

This have also be done for HTTP core events.

Sub-tasks

  • Add ConnectionContext to events.
  • Merge events with the same request type (connect, announce and scrape).

@josecelano josecelano requested a review from da2ce7 March 17, 2025 17:09
@josecelano josecelano self-assigned this Mar 17, 2025
@josecelano josecelano added Code Cleanup / Refactoring Tidying and Making Neat - Developer - Torrust Improvement Experience labels Mar 17, 2025
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

Attention: Patch coverage is 97.54386% with 7 lines in your changes missing coverage. Please review.

Project coverage is 81.91%. Comparing base (0428972) to head (8603f8b).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
...kages/udp-tracker-core/src/statistics/event/mod.rs 50.00% 6 Missing ⚠️
packages/udp-tracker-core/src/services/scrape.rs 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1381      +/-   ##
===========================================
+ Coverage    81.76%   81.91%   +0.15%     
===========================================
  Files          230      231       +1     
  Lines        16806    16974     +168     
  Branches     16806    16974     +168     
===========================================
+ Hits         13742    13905     +163     
- Misses        2821     2826       +5     
  Partials       243      243              

☔ 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.

@josecelano
Copy link
Member Author

ACK 8603f8b

@josecelano josecelano marked this pull request as ready for review March 17, 2025 17:26
@josecelano josecelano merged commit df507a8 into torrust:develop Mar 17, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Developer - Torrust Improvement Experience Code Cleanup / Refactoring Tidying and Making Neat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overhaul stats events: merge UDP core events with a different IP version
1 participant