trex

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CfgFileName                = "trex_cfg.yaml"
	StreamPyFileName           = "testpmd.py"
	StreamPeerParamsPyFileName = "testpmd_addr.py"
	StreamsPyPath              = "/opt/tests"
	ExecutionScriptName        = "run_trex_daemon"
	BinDirectory               = "/opt/trex"
	SystemdUnitFileName        = "trex.service"
)

Variables

This section is empty.

Functions

func GenerateSystemdUnitFile

func GenerateSystemdUnitFile() string

Types

type Client

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

func NewClient

func NewClient(trafficGenConsoleExpecter consoleExpecter,
	trafficGeneratorPacketsPerSecond string,
	testDuration time.Duration,
	verbosePrintsEnabled bool) Client

func (Client) ClearStats

func (c Client) ClearStats() (string, error)

func (Client) GetGlobalStats

func (c Client) GetGlobalStats() (GlobalStats, error)

func (Client) GetPortStats

func (c Client) GetPortStats(port PortIdx) (PortStats, error)

func (Client) StartServer

func (c Client) StartServer() error

func (Client) StartTraffic

func (c Client) StartTraffic(port PortIdx) (string, error)

func (Client) WaitForServerToBeReady

func (c Client) WaitForServerToBeReady(ctx context.Context) error

type Config

type Config struct {
	DPDKEastMacAddress string
	DPDKWestMacAddress string
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(cfg config.Config) Config

func (Config) GenerateCfgFile

func (c Config) GenerateCfgFile() string

func (Config) GenerateExecutionScript

func (c Config) GenerateExecutionScript() string

func (Config) GenerateStreamAddrPyFile

func (c Config) GenerateStreamAddrPyFile() string

func (Config) GenerateStreamPyFile

func (c Config) GenerateStreamPyFile() string

type GlobalStats

type GlobalStats struct {
	ID      string            `json:"id"`
	Jsonrpc string            `json:"jsonrpc"`
	Result  GlobalStatsResult `json:"result"`
}

type GlobalStatsResult

type GlobalStatsResult struct {
	MActiveFlows            float64 `json:"m_active_flows"`
	MActiveSockets          int64   `json:"m_active_sockets"`
	MBwPerCore              float64 `json:"m_bw_per_core"`
	MCPUUtil                float64 `json:"m_cpu_util"`
	MCPUUtilRaw             float64 `json:"m_cpu_util_raw"`
	MOpenFlows              float64 `json:"m_open_flows"`
	MPlatformFactor         float64 `json:"m_platform_factor"`
	MRxBps                  float64 `json:"m_rx_bps"`
	MRxCorePps              float64 `json:"m_rx_core_pps"`
	MRxCPUUtil              float64 `json:"m_rx_cpu_util"`
	MRxDropBps              float64 `json:"m_rx_drop_bps"`
	MRxPps                  float64 `json:"m_rx_pps"`
	MSocketUtil             float64 `json:"m_socket_util"`
	MTotalAllocError        int64   `json:"m_total_alloc_error"`
	MTotalClients           int64   `json:"m_total_clients"`
	MTotalNatActive         int64   `json:"m_total_nat_active"`
	MTotalNatLearnError     int64   `json:"m_total_nat_learn_error"`
	MTotalNatNoFid          int64   `json:"m_total_nat_no_fid"`
	MTotalNatOpen           int64   `json:"m_total_nat_open"`
	MTotalNatSynWait        int64   `json:"m_total_nat_syn_wait"`
	MTotalNatTimeOut        int64   `json:"m_total_nat_time_out"`
	MTotalNatTimeOutWaitAck int64   `json:"m_total_nat_time_out_wait_ack"`
	MTotalQueueDrop         int64   `json:"m_total_queue_drop"`
	MTotalQueueFull         int64   `json:"m_total_queue_full"`
	MTotalRxBytes           int64   `json:"m_total_rx_bytes"`
	MTotalRxPkts            int64   `json:"m_total_rx_pkts"`
	MTotalServers           int64   `json:"m_total_servers"`
	MTotalTxBytes           int64   `json:"m_total_tx_bytes"`
	MTotalTxPkts            int64   `json:"m_total_tx_pkts"`
	MTxBps                  float64 `json:"m_tx_bps"`
	MTxCps                  float64 `json:"m_tx_cps"`
	MTxExpectedBps          float64 `json:"m_tx_expected_bps"`
	MTxExpectedCps          float64 `json:"m_tx_expected_cps"`
	MTxExpectedPps          float64 `json:"m_tx_expected_pps"`
	MTxPps                  float64 `json:"m_tx_pps"`
}

type PortIdx

type PortIdx int
const (
	SourcePort PortIdx = iota
	DestPort
)

type PortStats

type PortStats struct {
	ID      string          `json:"id"`
	Jsonrpc string          `json:"jsonrpc"`
	Result  PortStatsResult `json:"result"`
}

type PortStatsResult

type PortStatsResult struct {
	Ibytes      int64   `json:"ibytes"`
	Ierrors     int64   `json:"ierrors"`
	Ipackets    int64   `json:"ipackets"`
	MCPUUtil    float64 `json:"m_cpu_util"`
	MTotalRxBps float64 `json:"m_total_rx_bps"`
	MTotalRxPps float64 `json:"m_total_rx_pps"`
	MTotalTxBps float64 `json:"m_total_tx_bps"`
	MTotalTxPps float64 `json:"m_total_tx_pps"`
	Obytes      int64   `json:"obytes"`
	Oerrors     int64   `json:"oerrors"`
	Opackets    int64   `json:"opackets"`
}

Jump to

Keyboard shortcuts

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