Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: rename TorrentsMetrics to AggregateSwarmMetadata #1361

Conversation

josecelano
Copy link
Member

TorrentsMetrics has been refactored and moved to the swarm_metadata module.

From (packages/primitives/src/torrent_metrics.rs):

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

To (packages/primitives/src/swarm_metadata.rs):

pub struct AggregateSwarmMetadata {
    pub total_complete: u64,
    pub total_downloaded: u64,
    pub total_incomplete: u64,
    pub total_torrents: u64,
}

@josecelano josecelano self-assigned this Mar 7, 2025
@josecelano josecelano added the Code Cleanup / Refactoring Tidying and Making Neat label Mar 7, 2025
@josecelano josecelano linked an issue Mar 7, 2025 that may be closed by this pull request
…SwarmMetadata)

To avoid confusion with `SwarmMetadata`

- `SwarmMetadata`: metrics for one torrent.
- `AggregateSwarmMetadata`: metrics for all torrents.
@josecelano josecelano force-pushed the 1243-consider-refactoring-primitive-type-torrentsmetrics branch from 4a47c08 to 144a338 Compare March 7, 2025 09:07
@josecelano
Copy link
Member Author

ACK 144a338

Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 90.32258% with 12 lines in your changes missing coverage. Please review.

Project coverage is 81.43%. Comparing base (70c9b44) to head (144a338).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
packages/primitives/src/swarm_metadata.rs 0.00% 6 Missing ⚠️
...acker-api-server/src/v1/context/stats/responses.rs 0.00% 4 Missing ⚠️
...pository/src/repository/rw_lock_std_mutex_tokio.rs 83.33% 0 Missing and 1 partial ⚠️
...pository/src/repository/rw_lock_tokio_mutex_std.rs 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1361      +/-   ##
===========================================
+ Coverage    81.39%   81.43%   +0.03%     
===========================================
  Files          230      229       -1     
  Lines        16500    16500              
  Branches     16500    16500              
===========================================
+ Hits         13430    13436       +6     
+ Misses        2830     2821       -9     
- Partials       240      243       +3     

☔ 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 cd3d4fd into torrust:develop Mar 7, 2025
23 checks passed
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.

Consider refactoring primitive type TorrentsMetrics
1 participant