Documentation ¶
Overview ¶
Package tgconsumer implements a traffic generator consumer.
Index ¶
- type Config
- type Consumer
- func (consumer *Consumer) ClearCounters()
- func (consumer *Consumer) Close() error
- func (consumer *Consumer) Interval() time.Duration
- func (consumer *Consumer) Launch()
- func (consumer *Consumer) ReadCounters() (cnt Counters)
- func (consumer *Consumer) RxQueue() *iface.PktQueue
- func (consumer *Consumer) SetInterval(interval time.Duration)
- func (consumer *Consumer) SetLCores(rxLCore, txLCore eal.LCore)
- func (consumer *Consumer) Stop(delay time.Duration) error
- type Counters
- type PacketCounters
- type Pattern
- type PatternCounters
- type RttCounters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { RxQueue iface.PktQueueConfig `json:"rxQueue,omitempty"` Patterns []Pattern `json:"patterns"` Interval nnduration.Nanoseconds `json:"interval"` }
Config contains traffic generator consumer configuration.
type Consumer ¶
type Consumer struct { Rx ealthread.Thread Tx ealthread.Thread // contains filtered or unexported fields }
Consumer represents a traffic generator consumer instance.
func (*Consumer) ClearCounters ¶
func (consumer *Consumer) ClearCounters()
ClearCounters clears counters. Both RX and TX threads should be stopped before calling this, otherwise race conditions may occur.
func (*Consumer) Close ¶
Close closes the consumer. Both RX and TX threads must be stopped before calling this.
func (*Consumer) ReadCounters ¶
ReadCounters retrieves counters.
func (*Consumer) SetInterval ¶
SetInterval sets average Interest interval. TX thread transmits Interests in bursts, so the specified interval will be converted to a burst interval with equivalent traffic amount.
type Counters ¶
type Counters struct { PacketCounters NAllocError uint64 `json:"nAllocError"` Rtt RttCounters `json:"rtt"` PerPattern []PatternCounters `json:"perPattern"` }
Counters contains consumer counters.
type PacketCounters ¶
type PacketCounters struct { NInterests uint64 `json:"nInterests"` NData uint64 `json:"nData"` NNacks uint64 `json:"nNacks"` }
PacketCounters is a group of network layer packet counters.
func (PacketCounters) ComputeDataRatio ¶
func (cnt PacketCounters) ComputeDataRatio() float64
ComputeDataRatio returns NData/NInterests.
func (PacketCounters) ComputeNackRatio ¶
func (cnt PacketCounters) ComputeNackRatio() float64
ComputeNackRatio returns NNacks/NInterests.
func (PacketCounters) String ¶
func (cnt PacketCounters) String() string
type Pattern ¶
type Pattern struct { Weight int `json:"weight,omitempty"` // weight of random choice, minimum/default is 1 Prefix ndn.Name `json:"prefix"` CanBePrefix bool `json:"canBePrefix,omitempty"` MustBeFresh bool `json:"mustBeFresh,omitempty"` InterestLifetime nnduration.Milliseconds `json:"interestLifetime,omitempty"` HopLimit ndn.HopLimit `json:"hopLimit,omitempty"` // If non-zero, request cached Data. This must appear after a pattern without SeqNumOffset. // The client derives sequece number by subtracting SeqNumOffset from the previous pattern's // sequence number. Sufficient CS capacity is necessary for Data to actually come from CS. SeqNumOffset int `json:"seqNumOffset,omitempty"` }
Pattern configures how the consumer generates a sequence of Interests.
type PatternCounters ¶
type PatternCounters struct { PacketCounters Rtt RttCounters `json:"rtt"` }
PatternCounters contains per-pattern counters.
func (PatternCounters) String ¶
func (cnt PatternCounters) String() string
type RttCounters ¶
type RttCounters struct {
runningstat.Snapshot
}
RttCounters contains RTT statistics.
func (RttCounters) String ¶
func (cnt RttCounters) String() string