Update aggregate API to use binary megabytes and enhance documentation
- 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:
@@ -49,7 +49,7 @@ func TestHandlerResolveAndFetch(t *testing.T) {
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &env); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !env.OK || env.Data.FleetTotalOctets != 42 {
|
||||
if !env.OK || env.Data.FleetTotalMegabytes != octetsToMegabytes(42) {
|
||||
t.Fatalf("data: %+v", env.Data)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user