iperf

package
v0.0.0-...-0036acd Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServicePrefix = "service"
	ServerPrefix  = "iperf-server"
	ClientPrefix  = "iperf-client"
	RoleLabel     = "role"
	AppLabel      = "app"
)
View Source
const (
	JobPrefix = "job-"
	JobLable  = "job"
)
View Source
const (
	GB = 1000 * 1000 * 1000
	MB = 1000 * 1000
	KB = 1000

	GbitsSec = "Gbits/sec"
	MbitsSec = "Mbits/sec"
	KbitsSec = "Kbits/sec"
	BitsSec  = "bits/sec"

	GBytes = "GBytes"
	MBytes = "MBytes"
	KBytes = "KBytes"
	Bytes  = "Bytes"
)

Variables

This section is empty.

Functions

func HtmlTablePrint

func HtmlTablePrint(serverKeyMap map[string][]CSKey,
	statisMap map[CSKey]IperfClientStatis) string

func Round2DataStr

func Round2DataStr(data float64, isBW bool) string

Types

type CSKey

type CSKey struct {
	Server string
	Client string
}

type ClientConfig

type ClientConfig struct {
	Mode     string
	Parallel int32
	Interval int32
	Duration int32
	Udp      bool
	BwLimit  string
}

type Connect

type Connect struct {
	Socket     int    `json:"socket,omitempty"`
	LocalHost  string `json:"local_host,omitempty"`
	LocalPort  int    `json:"local_port,omitempty"`
	RemoteHost string `json:"remote_host,omitempty"`
	RemotePort int    `json:"remote_port,omitempty"`
}

type ConnectTo

type ConnectTo struct {
	Host string `json:"host,omitempty"`
	Port int    `json:"port,omitempty"`
}

type CpuUtilPercent

type CpuUtilPercent struct {
	HostTotal    float64 `json:"host_total"`
	HostUser     float64 `json:"jost_user"`
	HostSystem   float64 `json:"host_system"`
	RemoteTotal  float64 `json:"remote_total"`
	RemoteUser   float64 `json:"remote_user"`
	RemoteSystem float64 `json:"remote_system"`
}

type EndStream

type EndStream struct {
	Sender   Sender   `json:"sender,omitempty"`
	Receiver Receiver `json:"receiver,omitempty"`
	Udp      Udp      `json:"udp,omitempty"`
}

type IntervalSum

type IntervalSum struct {
	Start         float64 `json:"start"`
	End           float64 `json:"end"`
	Seconds       float64 `json:"seconds"`
	Bytes         float64 `json:"bytes"`
	BitsPerSecond float64 `json:"bits_per_second"`
}

type IperfClientStatis

type IperfClientStatis struct {
	Protocol     string
	Start        float64
	End          float64
	IntervalNum  int
	UdpStatis    UdpStatis
	SocketStatis []SocketStatis
	Version      string
	SystemInfo   string
	Timestamp    string
}

type IperfEnd

type IperfEnd struct {
	Streams        []EndStream    `json:"streams"`
	SumSent        SumSent        `json:"sum_sent,omitempty"`
	SumReceived    SumReceived    `json:"sum_received,omitempty"`
	Sum            Sum            `json:"sum,omitempty"`
	CpuUtilPercent CpuUtilPercent `json:"cpu_utilization_percent"`
}

type IperfInterval

type IperfInterval struct {
	Streams []Stream    `json:"streams"`
	Sum     IntervalSum `json:"sum"`
}

type IperfJob

type IperfJob struct {
	Namespace    string
	Name         string
	JobNode      string
	Image        string
	ServerIp     string
	ServerPort   int32
	ClientConfig ClientConfig
	// contains filtered or unexported fields
}

func NewIperfJob

func NewIperfJob(namespace, jobNode, image, serverIp string,
	serverPort int32,
	config ClientConfig,
	ownerRef metav1.OwnerReference) *IperfJob

func (*IperfJob) Run

func (job *IperfJob) Run(k8sClient kubernetes.Interface) (string, error)

type IperfJson

type IperfJson struct {
	Start     IperfStart      `json:"start"`
	Intervals []IperfInterval `json:"intervals"`
	End       IperfEnd        `json:"end"`
}

func ParseLog

func ParseLog(log string) (*IperfJson, error)

func (*IperfJson) Analyse

func (j *IperfJson) Analyse() IperfClientStatis

type IperfStart

type IperfStart struct {
	Connected     []Connect `json:"connected,omitempty"`
	Version       string    `json:"version"`
	SystemInfo    string    `json:"system_info"`
	Timestamp     Timestamp `json:"timestamp,omitempty"`
	ConnectTo     ConnectTo `json:"connecting_to,omitempty"`
	Cookie        string    `json:"cookie,omitempty"`
	TcpMssDefault int       `json:"tcp_mss_default,omitempty"`
	TestStart     TestStart `json:"test_start,omitempty"`
}

type IperfTaskDeployer

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

func NewIperfTaskDeployer

func NewIperfTaskDeployer(k8sClient kubernetes.Interface,
	iperfClient iperfalpha1clientset.Interface,
	info *IperfTaskInfo) *IperfTaskDeployer

func (*IperfTaskDeployer) Run

func (deployer *IperfTaskDeployer) Run() (string, error)

type IperfTaskInfo

type IperfTaskInfo struct {
	Namespace string
	Name      string
	Uid       string
	ToEmail   string
	Image     string

	Port         int32
	ClientConfig ClientConfig
	// contains filtered or unexported fields
}

func NewIperfTaskInfo

func NewIperfTaskInfo(iperfTask *iperfalpha1.IperfTask, namespace, name, uid string) *IperfTaskInfo

func (*IperfTaskInfo) GetIperfTask

func (info *IperfTaskInfo) GetIperfTask() *iperfalpha1.IperfTask

type Receiver

type Receiver struct {
	Socket        int     `json:"socket,omitempty"`
	Start         float64 `json:"start"`
	End           float64 `json:"end"`
	Seconds       float64 `json:"seconds"`
	Bytes         float64 `json:"bytes"`
	BitsPerSecond float64 `json:"bits_per_second"`
}

type Sender

type Sender struct {
	Socket        int     `json:"socket,omitempty"`
	Start         float64 `json:"start"`
	End           float64 `json:"end"`
	Seconds       float64 `json:"seconds"`
	Bytes         float64 `json:"bytes"`
	BitsPerSecond float64 `json:"bits_per_second"`
	Retransmits   int     `json:"retransmits"`
}

type SocketStatis

type SocketStatis struct {
	Id           int
	TotalTrans   float64
	MinBandWidth float64
	MaxBandWidth float64
	AvgBandWidth float64
}

type Stream

type Stream struct {
	Socket        int     `json:"socket,omitempty"`
	Packets       int     `json:"packets,omitempty"`
	Start         float64 `json:"start"`
	End           float64 `json:"end"`
	Seconds       float64 `json:"seconds"`
	Bytes         float64 `json:"bytes"`
	BitsPerSecond float64 `json:"bits_per_second"`
}

type Sum

type Sum struct {
	Start         float64 `json:"start"`
	End           float64 `json:"end"`
	Seconds       float64 `json:"seconds"`
	Bytes         float64 `json:"bytes"`
	BitsPerSecond float64 `json:"bits_per_second"`
	JitterMs      float64 `json:"jitter_ms"`
	LostPackets   int     `json:"lost_packets"`
	Packets       int     `json:"packets"`
	LostPercent   float64 `json:"lost_percent"`
}

type SumReceived

type SumReceived struct {
	Start         float64 `json:"start"`
	End           float64 `json:"end"`
	Seconds       float64 `json:"seconds"`
	Bytes         float64 `json:"bytes"`
	BitsPerSecond float64 `json:"bits_per_second"`
	Retransmits   int     `json:"retransmits"`
}

type SumSent

type SumSent struct {
	Start         float64 `json:"start"`
	End           float64 `json:"end"`
	Seconds       float64 `json:"seconds"`
	Bytes         float64 `json:"bytes"`
	BitsPerSecond float64 `json:"bits_per_second"`
	Retransmits   int     `json:"retransmits"`
}

type TestStart

type TestStart struct {
	Protocol   string `json:"protocol,omitempty"`
	NumStreams int    `json:"num_streams,omitempty"`
	BlkSize    int64  `json:"blksize,omitempty"`
	Duration   int    `json:"duration,omitempty"`
}

type Timestamp

type Timestamp struct {
	Time     string `json:"time,omitempty"`
	Timesecs int64  `json:"timesecs,omitempty"`
}

type Udp

type Udp struct {
	Receiver
	JitterMs    float64 `json:"jitter_ms"`
	LostPackets int     `json:"lost_packets"`
	Packets     int     `json:"packets"`
	LostPercent float64 `json:"lost_percent"`
}

type UdpStatis

type UdpStatis struct {
	JitterMs      float64
	LostPackets   int
	Packets       int
	LostPercent   float64
	BitsPerSecond float64
}

Jump to

Keyboard shortcuts

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