From b1ae8bc13e36233c9fa50122baa481fa8e3ba99a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Wed, 12 Sep 2018 15:41:54 +0200 Subject: [PATCH] Show data usage in summary of measurements --- internal/cli/list/list.go | 4 ++-- internal/database/actions.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/cli/list/list.go b/internal/cli/list/list.go index 28ebd92..4a8bbf4 100644 --- a/internal/cli/list/list.go +++ b/internal/cli/list/list.go @@ -34,11 +34,11 @@ func init() { TotalRuntime: 0, } for _, msmt := range measurements { + // We assume that since these are summary level information the first + // item will contain the information necessary. if msmtSummary.TotalRuntime == 0 { msmtSummary.TotalRuntime = msmt.ResultRuntime } - // FIXME this logic should be adjusted for test groups that have many - // measurements in them if msmtSummary.DataUsageUp == 0 { msmtSummary.DataUsageUp = msmt.DataUsageUp msmtSummary.DataUsageDown = msmt.DataUsageDown diff --git a/internal/database/actions.go b/internal/database/actions.go index a0b3f89..84699ed 100644 --- a/internal/database/actions.go +++ b/internal/database/actions.go @@ -34,6 +34,7 @@ func ListMeasurements(sess sqlbuilder.Database, resultID int64) ([]MeasurementUR db.Raw("networks.*"), db.Raw("urls.*"), db.Raw("measurements.*"), + db.Raw("results.*"), ).From("results"). Join("measurements").On("results.id = measurements.result_id"). Join("networks").On("results.network_id = networks.id").