Skip to content

Commit 938e37e

Browse files
authored
Adds 10s to all v1 sample timestamps so that v1 matches v2-style timestamps. (#954)
1 parent cfd7374 commit 938e37e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

parser/disco.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ func (dp *DiscoParser) ParseAndInsert(meta map[string]bigquery.Value, testName s
103103
stats.Sample = tmp.Sample
104104
} else {
105105
stats.Sample = tmp.Sample[:len(tmp.Sample)-1]
106+
// DISCOv1's Timestamp field in each sample represents the
107+
// *beginning* of a 10s sample window, while v2's Timestamp
108+
// represents the time at which the sample was taken, which is
109+
// representative of the previous 10s. Since v2's behavior is
110+
// what we want, we add 10s to all v1 Timestamps so that the
111+
// timestamps represent the same thing for v1 and v2.
112+
for i, v := range stats.Sample {
113+
stats.Sample[i].Timestamp = v.Timestamp + 10
114+
}
106115
}
107116
}
108117

0 commit comments

Comments
 (0)