Skip to content

Overhaul stats: Extract events package (part 2) - #1483

Merged
josecelano merged 8 commits into
torrust:developfrom
josecelano:1480-overhaul-stats-extract-events-package-part-2
Apr 28, 2025
Merged

josecelano merged 8 commits into
torrust:developfrom
josecelano:1480-overhaul-stats-extract-events-package-part-2

Conversation

@josecelano

@josecelano josecelano commented Apr 28, 2025 •

Copy link
Copy Markdown
Member

Extract the new events package.

Subtasks

  • Create a new workspace package events.
  • Move the code from packages/http-tracker-core/src/event and make it generic.
  • Use the new generic event types in the packages:
    • http-tracker-core
    • udp-tracker-core
    • udp-tracker-server

@josecelano josecelano self-assigned this Apr 28, 2025
@josecelano josecelano linked an issue Apr 28, 2025 that may be closed by this pull request
@josecelano josecelano added the Code Cleanup / Refactoring Tidying and Making Neat label Apr 28, 2025
@josecelano
josecelano requested a review from da2ce7 April 28, 2025 10:39
@codecov

codecov Bot commented Apr 28, 2025 •

Copy link
Copy Markdown

Codecov Report

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

Project coverage is 84.36%. Comparing base (b211854) to head (540520c).
Report is 9 commits behind head on develop.

Files with missing lines Patch % Lines
packages/events/src/bus.rs 70.00% 6 Missing ⚠️
packages/events/src/sender.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1483      +/-   ##
===========================================
- Coverage    84.36%   84.36%   -0.01%     
===========================================
  Files          253      250       -3     
  Lines        19783    19719      -64     
  Branches     19783    19719      -64     
===========================================
- Hits         16690    16636      -54     
+ Misses        2788     2779       -9     
+ Partials       305      304       -1     

☔ 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 force-pushed the 1480-overhaul-stats-extract-events-package-part-2 branch from 762d632 to 29b00c8 Compare April 28, 2025 11:20
@josecelano

Copy link
Copy Markdown
Member Author

ACK 540520c

@josecelano
josecelano marked this pull request as ready for review April 28, 2025 16:43
@josecelano
josecelano requested a review from a team as a code owner April 28, 2025 16:43
@josecelano
josecelano merged commit b6ed3f3 into torrust:develop Apr 28, 2025
josecelano added a commit that referenced this pull request Apr 29, 2025
d98d93f refactor: [#1485] simplify event mods in pakages using the events pkg (Jose Celano)
97eb20a test: [#1485] add unit tests to events pkg (Jose Celano)
5a087d0 refactor: [#1485] replace Arc<Box<dyn Sender>> with Arc<dyn Sender> to avoid double allocations (Jose Celano)
8f5b57e refactor: [#1485] replace Arc<Option> with Option<Arc> in events pkg (Jose Celano)
c2df95f refactor: [#1485] rename trait fn send_event to send (Jose Celano)
f546bc1 refactor: [#1485] normalize event type parameter name in events pkg (Jose Celano)
3057f48 refactor: [#1485] decouple events traits from tokio broadcast channel implementation (Jose Celano)
e3703c1 feat: [#1485] add Receiver trait to events package (Jose Celano)
d4343c0 fix: [#1485] remove duplicate const (Jose Celano)

Pull request description:

  Continuation of #1483

  ### Subtasks

  - [x] `Receiver` trait.
  - [x] Decouple `Sender` and `Receiver` traits from the tokio broadcast implementation. Wrapper for `SendError` and `RecvError`.
  - [x] Return an `Option<Arc<...>>` instead of an `Arc<Option<...>>` in the `EventBus` implementation.
  - [x] Replace `Arc<Box<dyn Sender>>` with `Arc<dyn Sender>` to avoid double allocations.
  - [x] Add unit tests.

ACKs for top commit:
  josecelano:
    ACK d98d93f

Tree-SHA512: 6798238ff6dc2f6e06ecd077c2f0ddd56cd1e52bbb803273535bde6eec5c1334603d26c78daedb82eac886c5146fc575430520c0d29e7565e0fcb32ecdfe112c
@da2ce7

da2ce7 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Post-merge note: this pull request requested a review from this account and was closed without one at its final head. A post-merge review will not be done: Only 93 of the 195 executable lines it added remain on the default branch, at their own paths or in the files those paths were later renamed to; the rest has since been rewritten or removed.

This branch was previously deployed

1 inactive deployment
coverage — 540520c1 Deployed Apr 28, 2025 by josecelano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Cleanup / Refactoring Tidying and Making Neat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overhaul stats: Extract events package (part 2)

2 participants