Skip to content

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

@josecelano

Description

@josecelano

Relates to: #1358

I will add events to the torrent-repository package. Before doing it, I will make some changes to make the package easier to maintain.

The main problem is that we have numerous implementations of the repository with different data structures, primarily for testing performance. However, only one is used in production. There is no way to use the others because:

  1. They can not be injected dynamically.
  2. The alternatives are not ready for production. They don't have some of the features that were added to the one we use in production after running the performance tests. You can search for this string:
// todo: load persistent torrent data if provided

To find what was not implemented in the alternative implementations.

Since I'm going to introduce events (as we did for other packages, such as http-tracker-core, udp-tracker-core, and udp-tracker-server) that will require significant changes to the traits and implementations, it would be overkill to maintain all the implementations.

I suggest:

  • Isolating the implementations not used in production and keeping them only for the record or executing future benchmarking tests again.
  • Import the bittorrent_tracker_core::torrent::repository::in_memory::InMemoryTorrentRepository type from the tracker-repo. I think it belongs to this package since it's only one of the implementations of the torrent repository (the one used in production).
  • Simplify the repository using concrete types instead of generics.

cc @da2ce7

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions