88 "strings"
99 "time"
1010
11- "cloud.google.com/go/bigquery"
12-
13- "cloud.google.com/go/civil"
1411 "github.com/m-lab/etl/etl"
1512 "github.com/m-lab/etl/metrics"
1613 "github.com/m-lab/etl/row"
@@ -65,25 +62,25 @@ func (dp *NDT7ResultParser) IsParsable(testName string, data []byte) (string, bo
6562}
6663
6764// ParseAndInsert decodes the data.NDT7Result JSON and inserts it into BQ.
68- func (dp * NDT7ResultParser ) ParseAndInsert (meta map [ string ]bigquery. Value , testName string , test []byte ) error {
65+ func (dp * NDT7ResultParser ) ParseAndInsert (meta etl. Metadata , testName string , test []byte ) error {
6966 // TODO: derive 'ndt5' (or 'ndt7') labels from testName.
7067 metrics .WorkerState .WithLabelValues (dp .TableName (), "ndt7_result" ).Inc ()
7168 defer metrics .WorkerState .WithLabelValues (dp .TableName (), "ndt7_result" ).Dec ()
7269
7370 row := schema.NDT7ResultRow {
7471 Parser : schema.ParseInfo {
75- Version : Version () ,
72+ Version : meta . Version ,
7673 Time : time .Now (),
77- ArchiveURL : meta [ "filename" ].( string ) ,
74+ ArchiveURL : meta . ArchiveURL ,
7875 Filename : testName ,
79- GitCommit : GitCommit () ,
76+ GitCommit : meta . GitCommit ,
8077 },
8178 }
8279
8380 // Parse the test.
8481 err := json .Unmarshal (test , & row .Raw )
8582 if err != nil {
86- log .Println (meta [ "filename" ].( string ) , testName , err )
83+ log .Println (meta . ArchiveURL , testName , err )
8784 metrics .TestTotal .WithLabelValues (dp .TableName (), "ndt7_result" , "Unmarshal" ).Inc ()
8885 return err
8986 }
@@ -106,7 +103,7 @@ func (dp *NDT7ResultParser) ParseAndInsert(meta map[string]bigquery.Value, testN
106103 // the given timestamp, regardless of the timestamp's timezone. Since we
107104 // run our systems in UTC, all timestamps will be relative to UTC and as
108105 // will these dates.
109- row .Date = meta [ "date" ].(civil. Date )
106+ row .Date = meta . Date
110107 if row .Raw .Download != nil {
111108 row .A = downSummary (row .Raw .Download )
112109 } else if row .Raw .Upload != nil {
0 commit comments