[Feature] Stats API endpoint #1994
Merged
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.
📃 Description
This PR introduces a new
/api/v1/statsendpoint that summariesping,downloadanduploaddata.By default this endpoint returns "all time" stats butyou can filter these stats by providing a
start_atorend_atfilter.🪵 Changelog
➕ Added
/api/v1/statsendpoint✏️ Changed
bytesToBitshelper method👀 Data Dictionary
{ "data": { "ping": { "avg": 7.44, "min": 6.94, "max": 9.41 }, "download": { "avg": 116652966, "avg_bits": 933223730, "avg_bits_human": "933.22 Mbps", "min": 92564306, "min_bits": 740514448, "min_bits_human": "740.51 Mbps", "max": 117845746, "max_bits": 942765968, "max_bits_human": "942.77 Mbps" }, "upload": { "avg": 115043634, "avg_bits": 920349075, "avg_bits_human": "920.35 Mbps", "min": 96649510, "min_bits": 773196080, "min_bits_human": "773.20 Mbps", "max": 116693460, "max_bits": 933547680, "max_bits_human": "933.55 Mbps" }, "total_results": 238 }, "filters": { "start_at": ">=2025-01-01", "end_at": "<=2025-01-16" }, "message": "ok" }