Skip to content

Consider refactoring primitive type TorrentsMetrics #1243

@josecelano

Description

@josecelano

The type TorrentsMetrics includes the same info as the SwarmMetadata:

torrust_tracker_primitives::swarm_metadata
pub struct SwarmMetadata {
    pub downloaded: u32,
    pub complete: u32,
    pub incomplete: u32,
}

torrust_tracker_primitives::torrent_metrics
pub struct TorrentsMetrics {
    pub complete: u64,
    pub downloaded: u64,
    pub incomplete: u64,
    pub torrents: u64,
}

We could refactor it to:

torrust_tracker_primitives::torrent_metrics
pub struct TorrentsMetrics {
    pub swarm_metadata: SwarmMetadata,
    pub torrents: u64,
}

SwarmMetadata would not change.

What do you think @da2ce7?

IMPORTANT: do not start this refactor until I finish the Overhaul core::Tracker epic.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions