diff --git a/views/ndt/referenced-by/referenced-by/downloads.sql b/views/ndt/referenced-by/referenced-by/downloads.sql index 08dc4adc..9214a01d 100644 --- a/views/ndt/referenced-by/referenced-by/downloads.sql +++ b/views/ndt/referenced-by/referenced-by/downloads.sql @@ -1,6 +1,24 @@ #standardSQL --- All good quality download tests -SELECT * FROM `%s.ndt.recommended` +SELECT + -- All good quality download tests + *, + -- A synthetic column that conforms to our best practices. + -- The times are in microseconds, and dividing total throughput by total + -- microseconds yields mean throughput in Megabits per second. This + -- query excludes any time during which the connection was quiescent, + -- and as such is a fairer representation of how fast we were able to + -- push data down the pipe as compared to just dividing by + -- web100_log_entry.snap.Duration + -- + -- TODO: Delete this once https://github.com/m-lab/etl/issues/663 is + -- resolved. + STRUCT( + 8 * (web100_log_entry.snap.HCThruOctetsAcked / + (web100_log_entry.snap.SndLimTimeRwin + + web100_log_entry.snap.SndLimTimeCwnd + + web100_log_entry.snap.SndLimTimeSnd)) AS mean_download_throughput_mbps + ) as alpha +FROM `%s.ndt.recommended` WHERE -- download direction, and at least 8KB transfered connection_spec.data_direction IS NOT NULL