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 #1380

Closed
josecelano opened this issue Mar 17, 2025 · 0 comments · Fixed by #1381
Closed

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

josecelano opened this issue Mar 17, 2025 · 0 comments · Fixed by #1381
Assignees
Labels
- Developer - Torrust Improvement Experience

Comments

@josecelano
Copy link
Member

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.

@josecelano josecelano added the - Developer - Torrust Improvement Experience label Mar 17, 2025
@josecelano josecelano self-assigned this Mar 17, 2025
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Mar 17, 2025

Verified

This commit was signed with the committer’s verified signature.
josecelano Jose Celano
…ext to UDP core events
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Mar 17, 2025

Verified

This commit was signed with the committer’s verified signature.
josecelano Jose Celano
…nts with different IP version
josecelano added a commit that referenced this issue Mar 17, 2025

Verified

This commit was signed with the committer’s verified signature.
josecelano Jose Celano
…erent IP version

8603f8b refactor: [#1380] refactor: [#1373] merge UDP stats events with different IP version (Jose Celano)
2be682e refactor: [#1380] refactor: [#1371] add connection context to UDP core events (Jose Celano)

Pull request description:

  Change events from this:

  `bittorrent_udp_tracker_core::statistics::event::Event`:

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

  To this:

  ```rust
  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](#1374).

  ### Sub-tasks

  - [x] Add `ConnectionContext` to events.
  - [x] Merge events with the same request type (`connect`, `announce` and `scrape`).

ACKs for top commit:
  josecelano:
    ACK 8603f8b

Tree-SHA512: dde61535ec1f6c768ae2ad4d911e4ecece9be94c2546fd7b06a0d8d45d122caa6fcbf370cfa5de61a0d10424927cef17f7faf0a351252ab28ccb17e38058269e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Developer - Torrust Improvement Experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant