Documentation
¶
Index ¶
- func CalcLatencyMean(pkts gofluent10g.CapturePackets) float64
- func CalcLatencyStdDev(pkts gofluent10g.CapturePackets, latencyMean float64) float64
- func GenTraceCBR(datarate float64, pktlenWire, pktlenCapture int, duration time.Duration, ...) *gofluent10g.Trace
- func GenTraceRandom(datarateMean float64, pktlenCaptureMax int, duration time.Duration, ...) *gofluent10g.Trace
- type LatencyCDF
- type LatencyHistogram
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcLatencyMean ¶
func CalcLatencyMean(pkts gofluent10g.CapturePackets) float64
CalcLatencyMean calculates the mean latency based on a slice of captured packets.
func CalcLatencyStdDev ¶
func CalcLatencyStdDev(pkts gofluent10g.CapturePackets, latencyMean float64) float64
CalcLatencyStdDev calculates the latency standard deviation based on a slice of captured packets.
func GenTraceCBR ¶
func GenTraceCBR(datarate float64, pktlenWire, pktlenCapture int, duration time.Duration, nRepeats int) *gofluent10g.Trace
GenTraceCBR generates traffic with constant bit rate and packet lenghts. Only Ethernet and IPv4 headers are generated, payload bits are set to zero. datarate defines the target data rate, pktlenWire the length of the generated packets. pktlenCapture defines the number of data bytes that are written to the hardware, the hardware adds pktlenWire - pktlenCapture zero bytes to restore the original packet length. Since the Ethernet FCS is not included in the trace, but appended by the MAC, the condition pktlenCapture + 4 >= pktlenWire must always hold true. The duration parameter specifies the total duration of the generated trace. The parameter nRepeats determins how often the generated trace shall be replayed. Data is only generated for the first replay, the generator wraps around for all further replays.
func GenTraceRandom ¶
func GenTraceRandom(datarateMean float64, pktlenCaptureMax int, duration time.Duration, nRepeats int) *gofluent10g.Trace
GenTraceRandom generates random traffic with a mean data rate specified by the datarateMean (bits per second) parameter. The size of each packet is uniformly distributed between 64 and 1518 bytes (size of the Ethernet frame, i.e. starting with destination MAC address, ending with FCS). To reach the target mean data rate, a gap is inserted between packets. The length of the packet is determined by an exponential distribution. pktlenCaptureMax defines the maximum number of data bytes that are written to the hardware. Hardware then appends zero bytes to the packet to restore its original length. The duration parameter specifies the total duration of the generated trace. The parameter nRepeats determins how often the generated trace shall be replayed. Data is only generated for the first replay, the generator wraps around for all further replays.
Types ¶
type LatencyCDF ¶
type LatencyCDF []struct { Latency, Probability float64 }
LatencyCDF describes the data structure containing CDF data.
func CalcLatencyCDF ¶
func CalcLatencyCDF(pkts gofluent10g.CapturePackets) LatencyCDF
CalcLatencyCDF calculates a latency CDF based on a slice of captured packets.
type LatencyHistogram ¶
LatencyHistogram defines a struct that contains information on how often each latency value was recorded.
func CalcLatencyHistogram ¶
func CalcLatencyHistogram(pkts gofluent10g.CapturePackets) (LatencyHistogram, int)
CalcLatencyHistogram calculates the latency histogram based on a slice of captured packets. It returns the latency histogram as well as the total number of latency values.