Measure cable length from hardware transmit and receive timestamps
This commit is contained in:
@@ -216,7 +216,7 @@ func rateColor(gb, target float64) rgb {
|
||||
}
|
||||
}
|
||||
|
||||
func (d *display) render(dirs []*direction, views []view, elapsed time.Duration, target float64) {
|
||||
func (d *display) render(dirs []*direction, views []view, elapsed time.Duration, target float64, cable string) {
|
||||
fb := d.fb
|
||||
fb.fill(uiBg)
|
||||
|
||||
@@ -248,7 +248,7 @@ func (d *display) render(dirs []*direction, views []view, elapsed time.Duration,
|
||||
avail := fb.h - (bandY + bandH) - btnH - 2*uiMargin
|
||||
y := bandY + bandH + 8 + (avail-2*sectionH-gap)/2
|
||||
|
||||
y = d.section(y, "RATE")
|
||||
y = d.section(y, "RATE", "")
|
||||
d.rightAt(colTxGbEnd, y, "TX Gb/s", uiDim)
|
||||
d.rightAt(colTxPPSEnd, y, "TX pps", uiDim)
|
||||
d.rightAt(colRxGbEnd, y, "RX Gb/s", uiDim)
|
||||
@@ -265,7 +265,7 @@ func (d *display) render(dirs []*direction, views []view, elapsed time.Duration,
|
||||
}
|
||||
|
||||
y += gap
|
||||
y = d.section(y, "OVERALL")
|
||||
y = d.section(y, "OVERALL", cable)
|
||||
d.rightAt(colFramesEnd, y, "frames", uiDim)
|
||||
d.rightAt(colDataEnd, y, "data", uiDim)
|
||||
d.rightAt(colLostEnd, y, "lost", uiDim)
|
||||
@@ -289,8 +289,13 @@ func (d *display) render(dirs []*direction, views []view, elapsed time.Duration,
|
||||
fb.flush()
|
||||
}
|
||||
|
||||
func (d *display) section(y int, title string) int {
|
||||
// The right-hand annotation sits above the table's last column so it lines up
|
||||
// with the numbers under it rather than with the rule.
|
||||
func (d *display) section(y int, title, right string) int {
|
||||
d.small.draw(d.fb, uiMargin, y, title, uiFg)
|
||||
if right != "" {
|
||||
d.right(d.small, d.cellX(colKdropEnd), y, right, uiCyan)
|
||||
}
|
||||
ruleY := y + d.small.cellH + 3
|
||||
d.fb.rect(uiMargin, ruleY, d.fb.w-2*uiMargin, 1, uiRule)
|
||||
return ruleY + 7
|
||||
|
||||
Reference in New Issue
Block a user