Skip to content

Commit

Permalink
Adds a synthetic column for our most common query. (#37)
Browse files Browse the repository at this point in the history
* Adds a synthetic column for our most common query.
* Put the name in a struct called 'alpha'
* Add TODO to revert this change.
  • Loading branch information
pboothe authored May 22, 2019
1 parent 78b1373 commit d089fd1
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions views/ndt/referenced-by/referenced-by/downloads.sql
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit d089fd1

Please sign in to comment.