Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferState ¶
type BufferState struct {
QdiscName string `json:"qdiscName"`
Parent string `json:"parent"`
Rule string `json:"rule"`
SentBytes int64 `json:"sentBytes"`
SentPackets int64 `json:"sentPackets"`
DroppedPackets int64 `json:"droppedPackets"`
Overlimits int64 `json:"overlimits"`
Requeues int64 `json:"requeues"`
BacklogBytes int64 `json:"backlogBytes"`
BacklogPackets int64 `json:"backlogPackets"`
}
func GetBufferState ¶
func GetBufferState(form *BufferStateForm) ([]*BufferState, error)
type BufferStateForm ¶
type BufferStateForm struct {
NIC string `json:"nic"`
}
type Controller ¶
type Controller struct {
NICNetemExecutorMap map[string]*NetemExecutor
NICQueueExecutorMap map[string]*QueueExecutor
}
func GetController ¶
func GetController() *Controller
func (*Controller) ExecuteNetem ¶
func (c *Controller) ExecuteNetem(form *NetemForm) error
func (*Controller) UnsetAllNetem ¶
func (c *Controller) UnsetAllNetem() []string
type NetemExecutor ¶
type NetemExecutor struct {
// contains filtered or unexported fields
}
type NetemForm ¶
type NetemForm struct {
// detailed props description:
// https://man7.org/linux/man-pages/man8/tc-netem.8.html
NIC string `json:"nic"`
DelayMs float64 `json:"delayMs"`
DelayJitterMs float64 `json:"delayJitterMs"`
DelayCorrelationPercent float64 `json:"delayCorrelationPercent"`
DelayDistribution string `json:"delayDistribution"`
LossRandomPercent float64 `json:"lossRandomPercent"`
LossRandomCorrelationPercent float64 `json:"lossRandomCorrelationPercent"`
LossStateP13 float64 `json:"lossStateP13"`
LossStateP31 float64 `json:"lossStateP31"`
LossStateP32 float64 `json:"lossStateP32"`
LossStateP23 float64 `json:"lossStateP23"`
LossStateP14 float64 `json:"lossStateP14"`
LossGEModelPercent float64 `json:"lossGEModelPercent"`
LossGEModelR float64 `json:"lossGEModelR"`
LossGEModel1H float64 `json:"lossGEModel1H"`
LossGEModel1K float64 `json:"lossGEModel1K"`
LossECN bool `json:"lossECN"`
CorruptPercent float64 `json:"corruptPercent"`
CorruptCorrelationPercent float64 `json:"corruptCorrelationPercent"`
DuplicatePercent float64 `json:"duplicatePercent"`
DuplicateCorrelationPercent float64 `json:"duplicateCorrelationPercent"`
ReorderPercent float64 `json:"reorderPercent"`
ReorderCorrelationPercent float64 `json:"reorderCorrelationPercent"`
ReorderGapDistance float64 `json:"reorderGapDistance"`
RateKbps float64 `json:"rateKbps"`
SlotMinDelayMs float64 `json:"slotMinDelayMs"`
SlotMaxDelayMs float64 `json:"slotMaxDelayMs"`
SlotDistribution string `json:"slotDistribution"`
SlotDelayJitterMs float64 `json:"slotDelayJitterMs"`
SlotPackets int64 `json:"slotPackets"`
SlotBytes int64 `json:"slotBytes"`
QueueType string `json:"queueType"`
QueueLimitBytes int64 `json:"queueLimitBytes"`
QueueLimitPackets int64 `json:"queueLimitPackets"`
}
TODO: Implement the additional netem props
type QueueExecutor ¶
type QueueExecutor struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.