Commit 0c6d87c
committed
Merge #1229: Overhaul core Tracker: refactor statistics module
fd8b57a refactor: [#1228] remove deprecated unified HTTP and UDP stats (Jose Celano)
5576938 refactor: [#1228] get metrics from HTTP and UDP Tracker Core Stats (Jose Celano)
f33665d refactor: [#1228] start using the udp tracker stats (Jose Celano)
5f08b2e refactor: [#1228] start using the http tracker stats (Jose Celano)
39cbeda refactor: [#1228] add new UDP and HTTP stats services to AppContainer (Jose Celano)
700c912 docs: update tracker core docs (Jose Celano)
f99534a refactor: [#1228] split statistics mod into UDO and HTTP statistics (Jose Celano)
9318842 refactor: [#1228] move statistics back from tracker-core to main lib (Jose Celano)
0ad88b6 refactor: [#1228] move type from tracker-core to main lib (Jose Celano)
Pull request description:
Overhaul core Tracker: refactor statistics module.
Statistics have been split into three parts:
- HTTP stats
- UDP stats
- API stats: the API uses both HTTP metrics and UDP metrics.
I have created a temporary directory (`src/packages/`) with the new packages. We need to create crates for those packages and move them to the `src/packages/` dir.
I didn't want to do that in this PR.
```
$ tree src/packages/
src/packages/
├── http_tracker_core
│ ├── mod.rs
│ └── statistics
│ ├── event
│ │ ├── handler.rs
│ │ ├── listener.rs
│ │ ├── mod.rs
│ │ └── sender.rs
│ ├── keeper.rs
│ ├── metrics.rs
│ ├── mod.rs
│ ├── repository.rs
│ ├── services.rs
│ └── setup.rs
├── mod.rs
├── tracker_api_core
│ ├── mod.rs
│ └── statistics
│ ├── metrics.rs
│ ├── mod.rs
│ └── services.rs
└── udp_tracker_core
├── mod.rs
└── statistics
├── event
│ ├── handler.rs
│ ├── listener.rs
│ ├── mod.rs
│ └── sender.rs
├── keeper.rs
├── metrics.rs
├── mod.rs
├── repository.rs
├── services.rs
└── setup.rs
9 directories, 27 files
```
The app layers are a little bit different from what I described initially in the issue:
Initial design:
```
Main Torrust Tracker
|
Axum HTTP tracker server (`packages\axum-http-tracker`. This hasn't been extracted yet)
|
HTTP tracker protocol (`packages\http-protocol`)
|
Core tracker (`packages\tracker-core`)
```
Final design:
```
Main Torrust Tracker
|
Axum HTTP tracker server (`packages\axum-http-tracker`. This hasn't been extracted yet)
|
HTTP tracker core (`src\packages\http_tracker_core`)
|
HTTP tracker protocol (`packages\http-protocol`)
|
Core tracker (`packages\tracker-core`)
```
I din't want to put stats in the `packages\http-protocol` because they are no part of the official HTTP tracker protocols. And I didn't want to put it in the axum server because it's code that can be re-used in other server implementations (using other frameworks).
ACKs for top commit:
josecelano:
ACK fd8b57a
Tree-SHA512: 75adfaef2bb7f356b2a135183f9eb0306e91fa6dce3e4195ed21dda261139267bcc7cbb7589093dd67c2800ddce5aa172a7ebba19870794436db53890c5a32baFile tree
52 files changed
+1291
-720
lines changed- packages/tracker-core
- src
- statistics
- src
- bootstrap
- packages
- http_tracker_core
- statistics
- event
- tracker_api_core
- statistics
- udp_tracker_core
- statistics
- event
- servers
- apis/v1/context/stats
- http/v1
- handlers
- services
- udp
- server
- tests/servers
- api
- http
- v1
- udp
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
52 files changed
+1291
-720
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | 373 | | |
428 | 374 | | |
429 | 375 | | |
| |||
442 | 388 | | |
443 | 389 | | |
444 | 390 | | |
445 | | - | |
446 | 391 | | |
447 | 392 | | |
448 | 393 | | |
| |||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
96 | 106 | | |
97 | 107 | | |
98 | 108 | | |
| |||
133 | 143 | | |
134 | 144 | | |
135 | 145 | | |
136 | | - | |
137 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
138 | 150 | | |
139 | 151 | | |
140 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
109 | | - | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
| 497 | + | |
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| |||
File renamed without changes.
0 commit comments