Skip to content

Conversation

@josecelano
Copy link
Member

@josecelano josecelano commented May 27, 2025

Persist "all torrent downloads" metric.

Subtasks

  • Add new methods to the Database trait.
  • Make use of the new methods to persist the metric TRACKER_CORE_PERSISTENT_TORRENTS_DOWNLOADS_TOTAL.
  • Add an integration test.

…wnloads counter

It does not use the new methods in production yet.
@josecelano josecelano self-assigned this May 27, 2025
@josecelano josecelano requested a review from da2ce7 May 27, 2025 09:39
@josecelano josecelano added the - User - Enjoyable to Use our Software label May 27, 2025
@codecov
Copy link

codecov bot commented May 27, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 81 lines in your changes missing coverage. Please review.

Project coverage is 83.33%. Comparing base (3fce84b) to head (4febda4).
Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
...ackages/tracker-core/src/databases/driver/mysql.rs 0.00% 34 Missing ⚠️
...ckages/tracker-core/src/databases/driver/sqlite.rs 71.73% 4 Missing and 9 partials ⚠️
...s/tracker-core/src/statistics/persisted_metrics.rs 43.47% 10 Missing and 3 partials ⚠️
src/app.rs 33.33% 7 Missing and 1 partial ⚠️
...kages/tracker-core/src/statistics/event/handler.rs 36.36% 5 Missing and 2 partials ⚠️
packages/metrics/src/metric_collection.rs 85.00% 3 Missing ⚠️
...s/tracker-core/src/torrent/repository/persisted.rs 77.77% 1 Missing and 1 partial ⚠️
packages/tracker-core/src/statistics/repository.rs 93.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1540      +/-   ##
===========================================
- Coverage    83.52%   83.33%   -0.19%     
===========================================
  Files          273      274       +1     
  Lines        19317    19554     +237     
  Branches     19317    19554     +237     
===========================================
+ Hits         16134    16295     +161     
- Misses        2909     2969      +60     
- Partials       274      290      +16     

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

The total number of dowloads (for all torrents) is saved in the DB, but
not loaded yet.

todo: load the initial value when the tracker starts.
@josecelano josecelano marked this pull request as ready for review May 27, 2025 11:55
@josecelano josecelano marked this pull request as draft May 27, 2025 11:55
@josecelano
Copy link
Member Author

ACK 4febda4

@josecelano josecelano marked this pull request as ready for review May 27, 2025 12:18
@josecelano josecelano linked an issue May 27, 2025 that may be closed by this pull request
@josecelano josecelano merged commit 46df7eb into torrust:develop May 27, 2025
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

- User - Enjoyable to Use our Software

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overhaul stats: Persist all torrents downloads metric

1 participant