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

Overhaul stats: Use broadcast channel for events in HTTP Core #1391

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Mar 18, 2025

Stats events were introduced to collect tracker metrics. We only have global metrics (aggregate metrics for all UDP and HTTP trackers).

This will change in the future. We will have:

  • Segregated metrics: one listener per tracker (per socket).
  • Generic events: there could be other events consumers. Events will be decoupled from stats.

This change allows multiple receivers in the channel.

For now, we one use one listener but with this change will be easy to add more.

@josecelano josecelano force-pushed the 1388-overhaul-stats-use-broadcast-channel-for-events-in-http-core branch from 4e3260a to c57e151 Compare March 18, 2025 17:10
@josecelano josecelano requested a review from da2ce7 March 18, 2025 17:12
@josecelano josecelano self-assigned this Mar 18, 2025
@josecelano josecelano added the Code Cleanup / Refactoring Tidying and Making Neat label Mar 18, 2025
@josecelano josecelano linked an issue Mar 18, 2025 that may be closed by this pull request
…adcast

Stats events were introduced to collect tracker metrics. We only have global metrics (aggregate metrics for all UDP and HTTP trackers).

This will change in the future. We will have:

- Segregated metrics: one listeners per tracker (per socket).
- Generic events: there could be other event consumers. Events will be decoupled from stats.

This change allows multiple receivers in the channel.

For now, we one use one listener but with this change will be easy to add more.
@josecelano josecelano force-pushed the 1388-overhaul-stats-use-broadcast-channel-for-events-in-http-core branch from c57e151 to 5f9c4d3 Compare March 18, 2025 17:16
@josecelano
Copy link
Member Author

ACK 5f9c4d3

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 80.55556% with 7 lines in your changes missing coverage. Please review.

Project coverage is 81.88%. Comparing base (3ee074f) to head (5f9c4d3).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
...ages/http-tracker-core/src/statistics/event/mod.rs 0.00% 6 Missing ⚠️
...http-tracker-core/src/statistics/event/listener.rs 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1391      +/-   ##
===========================================
- Coverage    81.90%   81.88%   -0.02%     
===========================================
  Files          232      232              
  Lines        17091    17081      -10     
  Branches     17091    17081      -10     
===========================================
- Hits         13998    13987      -11     
+ Misses        2842     2841       -1     
- Partials       251      253       +2     

☔ 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 50463ae into torrust:develop Mar 18, 2025
22 of 23 checks passed
josecelano added a commit that referenced this pull request Mar 19, 2025
…Core

d2de1de refactor: [#1389] change channel in UDP core from mpsc to broadcast (Jose Celano)

Pull request description:

  This continues [this refactor](#1391) for the UDP core package.

ACKs for top commit:
  josecelano:
    ACK d2de1de

Tree-SHA512: 72ca8b7c24b691188bcecc8b2de83dec147b702621c3a340e113259131b1c023b268632894714b57ebbf84fe3147e3c6f57aa0a59a2f34d755eeaf0942d992c6
josecelano added a commit that referenced this pull request Mar 19, 2025
…Server

37c8f2b refactor: [#1390] change channel in UDP server from mpsc to broadcast (Jose Celano)

Pull request description:

  This continues [this refactor](#1391) for the UDP core package.

ACKs for top commit:
  josecelano:
    ACK 37c8f2b

Tree-SHA512: ca04ef293a6eb6d172a1a7dbbbc213d165274f574d15d5e8a521aea81795f067fb785c1307a64dae69ca31d1b2f30279082ea6ad10beb2ca13771101ea9b0069
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.

Overhaul stats: Use broadcast channel for events in HTTP Core
1 participant