Skip to content

Overhaul stats: Simplify torrent-repository package before adding events#1492

Merged
josecelano merged 20 commits intotorrust:developfrom
josecelano:1491-overhaul-stats-simplify-torrent-repository-package-before-adding-events
May 2, 2025
Merged

Overhaul stats: Simplify torrent-repository package before adding events#1492
josecelano merged 20 commits intotorrust:developfrom
josecelano:1491-overhaul-stats-simplify-torrent-repository-package-before-adding-events

Conversation

@josecelano
Copy link
Copy Markdown
Member

@josecelano josecelano commented Apr 30, 2025

Simplify torrent-repository package before adding events. It would be overkill to maintain all the implementations.

Subtasks

  • Copy benchmarking code to a new workspace package torrent-repository-benchmarking.
  • Remove code not used in production from the torrent-repository package.
    • Unused repositories
    • Unused entries
  • Remove unused traits RepositoryAsync, EntryAsync, Entry, EntrySync, etc.
  • Remove generics.
  • Rename main types
  • Import the bittorrent_tracker_core::torrent::repository::in_memory::InMemoryTorrentRepository type from the tracker-repo package. DISCARDED. See Overhaul stats: Emit events from the torrent-repository package and collect metrics #1358 (comment).
  • Clean tests

It will be removed from the `torrent-repository` package, keeping only
data strcutures used in production.
@josecelano josecelano self-assigned this Apr 30, 2025
@josecelano josecelano added the Code Cleanup / Refactoring Tidying and Making Neat label Apr 30, 2025
@josecelano josecelano added the - Developer - Torrust Improvement Experience label Apr 30, 2025
@josecelano josecelano requested a review from da2ce7 April 30, 2025 10:39
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 30, 2025

Codecov Report

Attention: Patch coverage is 97.83784% with 20 lines in your changes missing coverage. Please review.

Project coverage is 84.74%. Comparing base (659d174) to head (7215f6e).
Report is 21 commits behind head on develop.

Files with missing lines Patch % Lines
packages/torrent-repository/src/repository.rs 98.03% 7 Missing and 4 partials ⚠️
...ent-repository-benchmarking/src/entry/peer_list.rs 96.09% 8 Missing ⚠️
...s/rest-tracker-api-core/src/statistics/services.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1492      +/-   ##
===========================================
+ Coverage    84.30%   84.74%   +0.44%     
===========================================
  Files          255      259       +4     
  Lines        19878    20287     +409     
  Branches     19878    20287     +409     
===========================================
+ Hits         16758    17193     +435     
+ Misses        2806     2800       -6     
+ Partials       314      294      -20     

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

Repositories that are not used in production. THey have been moved to a
new package `torrent-repository-benchmarking`.
Entry types that are not used in production. They have been moved to a new package `torrent-repository-benchmarking`.
…sync

They have been moved to a new package `torrent-repository-benchmarking`.
This is part of a bigger refactor  makeing the torrent-repositoru
package impler. Only using types used in production and removing traits
that only have one implementation.
I don't know why it was not happening before. The previous changes only:

- Remove types aliases.
- Remove generics.
- Remove unused traits.

However the concrete type for the repository should be the same after
monomorphization.
josecelano added 3 commits May 2, 2025 11:22
…itory to TorrentRepository

InMemoryTorrentRepository is now a wrapper over TorrentRepository.

It's planned to make the InMemoryTorrentRepository responsible for triggering events.
josecelano added 2 commits May 2, 2025 11:59
Unneeded wrapper for TorrentRepository now that there is only one
implementaion.
@josecelano josecelano marked this pull request as ready for review May 2, 2025 11:52
@josecelano josecelano requested a review from a team as a code owner May 2, 2025 11:52
@josecelano
Copy link
Copy Markdown
Member Author

ACK 7215f6e

@josecelano josecelano merged commit a5c6e08 into torrust:develop May 2, 2025
21 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: Simplify torrent-repository package before adding events

1 participant