Skip to content

Conversation

@josecelano
Copy link
Member

This is a rework on top of #1370

It does not include moving the benchmark output report to the root dir until we implement the workflow to compare new results with the base branch results in a PR.

@josecelano josecelano requested a review from da2ce7 March 11, 2025 11:44
@josecelano josecelano self-assigned this Mar 11, 2025
@josecelano josecelano added Optimization Make it Faster Testing Checking Torrust labels Mar 11, 2025
@josecelano josecelano mentioned this pull request Mar 11, 2025
- http + udp tracker core bench mods
- bench sh script
@josecelano
Copy link
Member Author

ACK c155732

@codecov
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.58%. Comparing base (13e9aa8) to head (c155732).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1371      +/-   ##
===========================================
+ Coverage    81.31%   81.58%   +0.26%     
===========================================
  Files          229      229              
  Lines        16519    16618      +99     
  Branches     16519    16618      +99     
===========================================
+ Hits         13433    13558     +125     
+ Misses        2840     2818      -22     
+ Partials       246      242       -4     

☔ 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 josecelano merged commit 3d3d0c7 into torrust:develop Mar 11, 2025
23 checks passed
josecelano added a commit to josecelano/torrust-tracker that referenced this pull request Mar 11, 2025
josecelano added a commit to josecelano/torrust-tracker that referenced this pull request Mar 11, 2025
josecelano added a commit that referenced this pull request Mar 17, 2025
…ferent IP version

1f30f8e ci: update git hooks scripts (Jose Celano)
3969c67 refactor: [1373] include client's port in stats events when provided (Jose Celano)
b8a3d44 refactor: [#1373] capture socket address from connection info in HTTP tracker (Jose Celano)
2de6c14 refactor: [#1373] merge HTTP stats events with different IP version (Jose Celano)
6de2dd9 refactor: [#1371] add connection context to HTTP core events (Jose Celano)

Pull request description:

  Change HTTP core tracker events (`bittorrent_http_tracker_core::statistics::event::Event`) from this:

  ```rust
  pub enum Event {
      Tcp4Announce,
      Tcp4Scrape,
      Tcp6Announce,
      Tcp6Scrape,
  }
  ```

  To this:

  ```rust
  pub enum Event {
      TcpAnnounce { connection: ConnectionContext },
      TcpScrape { connection: ConnectionContext },
  }

  pub struct ConnectionContext {
      client: ClientConnectionContext,
      server: ServerConnectionContext,
  }

  pub struct ClientConnectionContext {
      ip_addr: IpAddr,
      port: Option<u16>,
  }

  pub struct ServerConnectionContext {
      socket_addr: SocketAddr,
  }

  ```

  ### Sub-tasks

  - [x] Add `ConnectionContext` to events.
  - [x] Merge events with the same request type (`announce` and `scrape`).
  - [x] Add client port to `ConnectionContext`. `ClientIpSources` type and the `packages/axum-http-tracker-server/src/v1/extractors/client_ip_sources.rs` Axum extractor have to be changed to include also the port.

ACKs for top commit:
  josecelano:
    ACK 1f30f8e

Tree-SHA512: a9fe256de2baf493a23ad61c2d80073e9b6c1dde578632dbed73532d19d4730f01563c1df172fbf353b9b12bf9dcea3ec1a16109fced4995c929f0daae330067
josecelano added a commit to josecelano/torrust-tracker that referenced this pull request Mar 17, 2025
josecelano added a commit that referenced this pull request Mar 17, 2025
…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

Optimization Make it Faster Testing Checking Torrust

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants