pkg

package
v0.0.0-...-864aa2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateLatency

func CalculateLatency(traces []*Trace, from_node int, to_node int, flow_start float64) ([]float64, []float64, float64)

Calculate latency vs time given a TCP flow start time Return slice times, slice throughputs, and average latency

func CalculateThroughput

func CalculateThroughput(traces []*Trace, from_node int, to_node int, flow_start float64, window_size float64) ([]float64, []float64, float64)

Calculate throughput vs time given a TCP flow start time Return slice times, slice throughputs, and average throughput

func CountDrops

func CountDrops(traces []*Trace) int

Count the number of dropped packets. The trace should already be filtered by fid

func Max

func Max(arr []float64) float64

Get the max from a slice of float64

func Mean

func Mean(arr []float64) float64

Get the avg from a slice of float64

func Min

func Min(arr []float64) float64

Get the min from a slice of float64

func Record

func Record(x, y []float64, xname, yname string, fname string)

Record the results of a single experiment trial and save it as a CSV file Parameters: x slice, y slice, x name, y name, filename

func StdDev

func StdDev(arr []float64) float64

Get the standard deviation from a slice of float64

func Sum

func Sum(arr []float64) float64

Get the sum from a slice of float64

Types

type Trace

type Trace struct {
	// contains filtered or unexported fields
}

func FilterByFid

func FilterByFid(traces []*Trace, fid int) []*Trace

Get a slice of traces of flow id 'fid'

func FilterByType

func FilterByType(traces []*Trace, packet_type string) []*Trace

Get a slice of traces of type 'packet_type' (tcp, cbr, ack)

func ParseTraceFile

func ParseTraceFile(file string) ([]*Trace, error)

Parse the trace file and return a slice of Trace structs

func (*Trace) String

func (t *Trace) String() string

String function for Trace struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL