Update aggregate API to use binary megabytes and enhance documentation
Publish telemt-api gateway Docker image / test (push) Successful in 27s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 1m26s

- Changed API responses and internal calculations to use binary megabytes (MiB) instead of octets for traffic metrics.
- Updated relevant endpoints in AGGREGATE.md to reflect the new metric units.
- Modified handler and merge logic to accommodate the new data structure and ensure accurate traffic reporting.
- Enhanced tests to validate the changes in traffic calculations and summary data.
- Deprecated the use of total_octets in favor of total_megabytes for consistency across the API.
This commit is contained in:
Denozordec
2026-03-30 01:04:00 +07:00
parent fb35107b82
commit 4a4f15bd0b
7 changed files with 89 additions and 35 deletions
+8
View File
@@ -0,0 +1,8 @@
package aggregate
// mebibyte — двоичный мегабайт (1024² октетов), в JSON полях *megabytes.
const mebibyte = 1024 * 1024
func octetsToMegabytes(o uint64) float64 {
return float64(o) / float64(mebibyte)
}