Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions sys_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ type SysInfo struct {
MinRTT time.Duration `json:"min_rtt"` // current measured minimum RTT; zero means not available
DataSegsOut uint `json:"data_segs_out"` // # of segments sent containing a positive length data segment
DataSegsIn uint `json:"data_segs_in"` // # of segments received containing a positive length data segment
DeliveryRate uint64 `json:"delivery_rate"` // # The most recent goodput, as measured by tcp_rate_gen()
BusyTime uint64 `json:"busy_time"` // # Time (usec) busy sending data
RwndLimited uint64 `json:"rwnd_limited"` // # Time (usec) limited by receive window
SndbufLimited uint64 `json:"sndbuf_limited"` // # Time (usec) limited by send buffer
AppLimited bool `json:"app_limited"` // A boolean indicating if the goodput was measured when the socket's
// throughput was limited by the sending application.
}

var sysStates = [12]State{Unknown, Established, SynSent, SynReceived, FinWait1, FinWait2, TimeWait, Closed, CloseWait, LastAck, Listen, Closing}
Expand Down Expand Up @@ -135,6 +141,11 @@ func parseInfo(b []byte) (tcpopt.Option, error) {
MinRTT: time.Duration(ti.Min_rtt) * time.Microsecond,
DataSegsIn: uint(ti.Data_segs_in),
DataSegsOut: uint(ti.Data_segs_out),
DeliveryRate: uint64(ti.Delivery_rate),
BusyTime: uint64(ti.Busy_time),
RwndLimited: uint64(ti.Rwnd_limited),
SndbufLimited: uint64(ti.Sndbuf_limited),
AppLimited: ti.App_limited != 0,
}
return i, nil
}
Expand Down
2 changes: 1 addition & 1 deletion zsys_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type tcpInfo struct {
Backoff uint8
Options uint8
Pad_cgo_0 [1]byte
Pad_cgo_1 [1]byte
App_limited byte
Rto uint32
Ato uint32
Snd_mss uint32
Expand Down