Skip to content

Commit 75bf073

Browse files
Convert MinRTT to milliseconds (#1129)
* Convert MinRTT to milliseconds * Update distribution for python3 and gcloud sdk * Update schema docs and notes for S2C fields published in nanoseconds
1 parent c213c5f commit 75bf073

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# The travis-ci.com configuration performs unit and integration tests, and code
66
# coverage only.
77

8-
dist: bionic
8+
dist: jammy # 22.04
99
language: go
1010
go:
1111
- 1.20

parser/ndt5_result.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ func (dp *NDT5ResultParser) prepareS2CRow(row *schema.NDT5ResultRowV2) {
176176
// Since the s2c.MinRTT value is a lower resolution user-space estimate,
177177
// use TCPInfo if present, and fall back to the low resolution MinRTT otherwise.
178178
if s2c.TCPInfo != nil {
179-
// TCPInfo.MinRTT is a uint32.
180-
row.A.MinRTT = float64(s2c.TCPInfo.MinRTT) / 1000.0 / 1000.0
179+
// TCPInfo.MinRTT is a uint32. Convert to milliseconds.
180+
row.A.MinRTT = float64(s2c.TCPInfo.MinRTT) / 1000.0
181181
} else {
182-
// MinRTT is a time.Duration.
182+
// s2c.MinRTT is a time.Duration. Convert back to milliseconds.
183183
row.A.MinRTT = float64(s2c.MinRTT) / float64(time.Millisecond)
184184
}
185185
// NOTE: the TCPInfo structure was introduced in v0.18.0. Measurements

parser/ndt5_result_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ func TestNDT5ResultParser_ParseAndInsert(t *testing.T) {
108108
download.Raw.S2C.UUID, download.A.UUID)
109109
}
110110
// Verify a.MinRTT when S2C.TCPInfo is present.
111-
if tt.expectTCPInfo && download.A.MinRTT != float64(download.Raw.S2C.TCPInfo.MinRTT)/1000.0/1000.0 {
111+
if tt.expectTCPInfo && download.A.MinRTT != float64(download.Raw.S2C.TCPInfo.MinRTT)/1000.0 {
112112
t.Fatalf("A.MinRTT does not match Raw.S2C.TCPInfo.MinRTT; got %f, want %f",
113-
download.A.MinRTT, float64(download.Raw.S2C.TCPInfo.MinRTT)/1000.0/1000.0)
113+
download.A.MinRTT, float64(download.Raw.S2C.TCPInfo.MinRTT)/1000.0)
114114
}
115115
// Verify a.MinRTT when S2C.TCPInfo is not present.
116116
if tt.expectMetadata && download.A.MinRTT != float64(download.Raw.S2C.MinRTT)/float64(time.Millisecond) {

schema/descriptions/NDT5ResultRowV2.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ a.MeanThroughputMbps:
1616
it is identified as "MeanThroughputMbps".
1717
a.MinRTT:
1818
Description: The minimum Round Trip Time observed during the measurement,
19-
recorded in milliseconds.
19+
recorded in milliseconds. Derived from TCPInfo.MinRTT after 2020-06-18.
2020
a.LossRate:
2121
Description: Loss rate from the lifetime of the connection.
2222

@@ -100,15 +100,13 @@ S2C:
100100
Description: Metadata for Server-to-Client (download) measurements performed
101101
using the ndt5 protocol.
102102
S2C.MinRTT:
103-
Description: The minimum RTT observed during the download measurement, recorded in milliseconds.
103+
Description: The application measured minimum observed round trip time, recorded in nanoseconds.
104104
S2C.MaxRTT:
105-
Description: The maximum sampled round trip time, recorded in milliseconds.
105+
Description: The application measured maximum sampled round trip time, recorded in nanoseconds.
106106
S2C.SumRTT:
107-
Description: The sum of all sampled round trip times, recorded in
108-
milliseconds.
107+
Description: The sum of all sampled round trip times, recorded in nanoseconds.
109108
S2C.CountRTT:
110-
Description: The number of round trip time samples included in S2C.SumRTT,
111-
reported in milliseconds.
109+
Description: The number of round trip time samples included in S2C.SumRTT.
112110
S2C.ClientReportedMbps:
113111
Description: The download rate as calculated by the client, in megabits per
114112
second, or Mbit/s. Not all clients report this value.
@@ -254,7 +252,7 @@ TCPInfo.NotsentBytes:
254252
sent.
255253
Kernel: tcpi_notsent_bytes() in net/ipv4/tcp.c
256254
TCPInfo.MinRTT:
257-
Description: Minimum Round Trip Time. From an older, pre-BBR algorithm.
255+
Description: Minimum Round Trip Time. From an older, pre-BBR algorithm. Recorded in microseconds.
258256
Kernel: tcp_min_rtt in include/net/tcp.h
259257
TCPInfo.DataSegsIn:
260258
Description: Input segments carrying data (len>0).

schema/descriptions/NDT7ResultRow.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ BBRInfo.BW:
5757
Description: The maximum end-to-end bandwidth from the server to the client
5858
as measured by BBR.
5959
BBRInfo.MinRTT:
60-
Description: The minimum round trip time as measured by BBR.
60+
Description: The minimum round trip time as measured by BBR. Recorded in microseconds.
6161
BBRInfo.PacingGain:
6262
Description: Fixed point multiplier used to set the pacing rate from the
6363
maximum bandwidth. The binary point varies by kernel version but the
@@ -207,7 +207,7 @@ TCPInfo.NotsentBytes:
207207
sent.
208208
Kernel: tcpi_notsent_bytes() in net/ipv4/tcp.c
209209
TCPInfo.MinRTT:
210-
Description: Minimum Round Trip Time. From an older, pre-BBR algorithm.
210+
Description: Minimum Round Trip Time. Recorded in microseconds.
211211
Kernel: tcp_min_rtt in include/net/tcp.h
212212
TCPInfo.DataSegsIn:
213213
Description: Input segments carrying data (len>0).

0 commit comments

Comments
 (0)