Merged
Conversation
The event is used for both UDP 4 and UDP 6 requests aborted.
Closed
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1176 +/- ##
===========================================
+ Coverage 76.00% 76.07% +0.06%
===========================================
Files 174 174
Lines 11567 11599 +32
Branches 11567 11599 +32
===========================================
+ Hits 8792 8824 +32
Misses 2606 2606
Partials 169 169 ☔ View full report in Codecov by Sentry. |
All UDP tracker will share the same service. In the future, the HTTP trackers can also use it. The service was not include inside the tracker (easy solution) becuase the Tracker type is too big. It has became the app container. In fact, we want to reduce it in the future by extracting the services outside of the tracker: stats, whitelist, etc. Those services will be instantiate independently in the future in the app bootstrap.
d9cfb38 to
1299f17
Compare
0bd080b to
d7f60a1
Compare
```json
{
"torrents": 0,
"seeders": 0,
"completed": 0,
"leechers": 0,
"tcp4_connections_handled": 0,
"tcp4_announces_handled": 0,
"tcp4_scrapes_handled": 0,
"tcp6_connections_handled": 0,
"tcp6_announces_handled": 0,
"tcp6_scrapes_handled": 0,
"udp_requests_aborted": 0,
"udp_requests_banned": 0,
"udp_banned_ips_total": 0,
"udp4_requests": 0,
"udp4_connections_handled": 0,
"udp4_announces_handled": 0,
"udp4_scrapes_handled": 0,
"udp4_responses": 0,
"udp4_errors_handled": 0,
"udp6_requests": 0,
"udp6_connections_handled": 0,
"udp6_announces_handled": 0,
"udp6_scrapes_handled": 0,
"udp6_responses": 0,
"udp6_errors_handled": 0
}
```
The new metric: `udp_banned_ips_total`. It's the total number of IPs that have been banned for sending wrong connection IDs.
d7f60a1 to
1ce2e33
Compare
… events - The `kind`is the type of response: connect, annouince, etc - The req_processing_time is the time it took to process the requests on the backend, without including sending the response back to the client (network latency).
```json
{
"torrents": 1,
"seeders": 1,
"completed": 0,
"leechers": 0,
"tcp4_connections_handled": 0,
"tcp4_announces_handled": 0,
"tcp4_scrapes_handled": 0,
"tcp6_connections_handled": 0,
"tcp6_announces_handled": 0,
"tcp6_scrapes_handled": 0,
"udp_requests_aborted": 0,
"udp_requests_banned": 0,
"udp_banned_ips_total": 0,
"udp_avg_connect_processing_time_ns": 37000,
"udp_avg_announce_processing_time_ns": 42067,
"udp_avg_scrape_processing_time_ns": 0,
"udp4_requests": 60,
"udp4_connections_handled": 30,
"udp4_announces_handled": 30,
"udp4_scrapes_handled": 0,
"udp4_responses": 60,
"udp4_errors_handled": 0,
"udp6_requests": 0,
"udp6_connections_handled": 0,
"udp6_announces_handled": 0,
"udp6_scrapes_handled": 0,
"udp6_responses": 0,
"udp6_errors_handled": 0
}
```
New metrcis are:
- udp_avg_connect_processing_time_ns
- udp_avg_announce_processing_time_ns
- udp_avg_scrape_processing_time_ns
e3327db to
903d47f
Compare
Member
Author
|
ACK 903d47f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add more metrics useful for detecting tracker errors and load level.
UDP
udp_requests_banned: the total number of UDP requests that have been banned.udp_banned_ips_total: the total number of IPs that have been banned for sending wrong connection IDs.udp_avg_connect_processing_time_ns: the average time processing a UDP connect request.udp_avg_announce_processing_time_ns: the average time processing a UDP announce request.udp_avg_scrape_processing_time_ns: the average time processing a UDP scrape request.Important refactor
I needed to pass the Ban Service to the stats handler to get some values. I did not want to add the ban service to the tracker because the tracker is already to "fat". It has many responsibilities. In fact, I want to extract new services out of the tracker like whitelist, authorization, etc. My plan was to extract them and leave the tracker as the application services container. However I think it will be easier if we:
BanServicedirectly to handlers instead of using the tracker as a facade.Trackerand also pass them directly to handlers.At the end, the
Trackershould have only a couple of methods likeannounceandscrape.