Skip to content

Conversation

@josecelano
Copy link
Member

@josecelano josecelano commented May 26, 2025

Relates to: #1502

It adds a new metric.

The new metric in Prometheus format:

tracker_core_persistent_torrents_downloads_total{} 1

In new PRs, the new metric will be persisted.

@josecelano josecelano self-assigned this May 26, 2025
@josecelano josecelano requested a review from da2ce7 May 26, 2025 17:44
@josecelano josecelano added Enhancement / Feature Request Something New - Admin - Enjoyable to Install and Setup our Software labels May 26, 2025
@codecov
Copy link

codecov bot commented May 26, 2025

Codecov Report

Attention: Patch coverage is 39.71631% with 85 lines in your changes missing coverage. Please review.

Project coverage is 83.52%. Comparing base (f21957d) to head (2175270).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
packages/tracker-core/src/statistics/repository.rs 25.37% 50 Missing ⚠️
packages/tracker-core/src/statistics/metrics.rs 24.24% 25 Missing ⚠️
...s/rest-tracker-api-core/src/statistics/services.rs 0.00% 5 Missing ⚠️
...racker-api-server/src/v1/context/stats/handlers.rs 0.00% 2 Missing ⚠️
...racker-client/src/http/client/requests/announce.rs 0.00% 2 Missing ⚠️
src/bootstrap/jobs/tracker_core.rs 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1536      +/-   ##
===========================================
- Coverage    83.89%   83.52%   -0.37%     
===========================================
  Files          270      273       +3     
  Lines        19181    19317     +136     
  Branches     19181    19317     +136     
===========================================
+ Hits         16091    16134      +43     
- Misses        2817     2909      +92     
- Partials       273      274       +1     

☔ 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 changed the title Overhaul stats: Add new persisted metric to the tracker-core (total downloads for all torrents) Overhaul stats: Scaffolding for metrics in the tracker-core package May 26, 2025
@josecelano josecelano linked an issue May 26, 2025 that may be closed by this pull request
New metric added:

```
tracker_core_persistent_torrents_downloads_total{} 1
```

However, it's not persisted yet.

TODO:

- Persist into the database when updated.
- Load from database when the tracker starts.
@josecelano josecelano force-pushed the 1535-overhaul-stats-persist-labeled-metrics branch from 14a1ffa to 2175270 Compare May 27, 2025 07:12
@josecelano josecelano marked this pull request as ready for review May 27, 2025 07:39
@josecelano
Copy link
Member Author

ACK 2175270

@josecelano josecelano merged commit 3fce84b 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

- Admin - Enjoyable to Install and Setup our Software Enhancement / Feature Request Something New

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overhaul stats: Scaffolding for metrics in tracker-core package

1 participant