mirror of
https://github.com/vishvananda/netlink
synced 2024-12-28 09:32:17 +00:00
Implemented String() for netem, fq and fq_codel in qdisc
This commit is contained in:
parent
769bb84935
commit
7c0b5944a3
21
qdisc.go
21
qdisc.go
@ -176,6 +176,13 @@ type Netem struct {
|
||||
CorruptCorr uint32
|
||||
}
|
||||
|
||||
func (netem *Netem) String() string {
|
||||
return fmt.Sprintf(
|
||||
"{Latency: %v, Limit: %v, Loss: %v, Gap: %v, Duplicate: %v, Jitter: %v}",
|
||||
netem.Latency, netem.Limit, netem.Loss, netem.Gap, netem.Duplicate, netem.Jitter,
|
||||
)
|
||||
}
|
||||
|
||||
func (qdisc *Netem) Attrs() *QdiscAttrs {
|
||||
return &qdisc.QdiscAttrs
|
||||
}
|
||||
@ -249,6 +256,13 @@ type Fq struct {
|
||||
LowRateThreshold uint32
|
||||
}
|
||||
|
||||
func (fq *Fq) String() string {
|
||||
return fmt.Sprintf(
|
||||
"{PacketLimit: %v, FlowPacketLimit: %v, Quantum: %v, InitalQuantum: %v, Pacing: %v, FlowDefaultRate: %v, FlowMaxRate: %v, Buckets: %v, FlowRefillDelay: %v, LowRateTreshold: %v}",
|
||||
fq.PacketLimit, fq.FlowPacketLimit, fq.Quantum, fq.InitialQuantum, fq.Pacing, fq.FlowDefaultRate, fq.FlowMaxRate, fq.Buckets, fq.FlowRefillDelay, fq.LowRateThreshold,
|
||||
)
|
||||
}
|
||||
|
||||
func NewFq(attrs QdiscAttrs) *Fq {
|
||||
return &Fq{
|
||||
QdiscAttrs: attrs,
|
||||
@ -276,6 +290,13 @@ type FqCodel struct {
|
||||
// There are some more attributes here, but support for them seems not ubiquitous
|
||||
}
|
||||
|
||||
func (fqcodel *FqCodel) String() string {
|
||||
return fmt.Sprintf(
|
||||
"{Target: %v, Limit: %v, Interval: %v, ECM: %v, Flows: %v, Quantum: %v}",
|
||||
fqcodel.Target, fqcodel.Limit, fqcodel.Interval, fqcodel.ECN, fqcodel.Flows, fqcodel.Quantum,
|
||||
)
|
||||
}
|
||||
|
||||
func NewFqCodel(attrs QdiscAttrs) *FqCodel {
|
||||
return &FqCodel{
|
||||
QdiscAttrs: attrs,
|
||||
|
Loading…
Reference in New Issue
Block a user