Documentation
¶
Overview ¶
#include <some_system_library.h>
Index ¶
- Constants
- func ParseBandwidth(valueKb float64) string
- type Bandwidth
- type BlockDevice
- type BlockDevices
- type ExecResult
- type FioOptions
- type FioTest
- type Guest
- func (guest Guest) Cat(args ...string) ExecResult
- func (guest *Guest) Connect() error
- func (guest Guest) ConnectToQGA(timeout int) error
- func (guest Guest) CopyFile(localFile string, remotePath string) (string, error)
- func (guest Guest) Exec(command string, wait bool) ExecResult
- func (guest Guest) FileWrite(filePath string, content string) error
- func (guest Guest) GetBlockDevices() (BlockDevices, error)
- func (guest Guest) GetExecStatusOutput(pid int) (string, string)
- func (guest Guest) GetIpaddrs() []string
- func (g *Guest) GetName() string
- func (guest Guest) HasCommand(command string) bool
- func (guest Guest) HostName() (string, error)
- func (g Guest) IsRunning() bool
- func (g Guest) IsSame(other Guest) bool
- func (g Guest) IsShutoff() bool
- func (guest Guest) Kill(single int, pids []int) ExecResult
- func (guest Guest) Ping(targetIp string, interval float32, count int, useInterface string, wait bool) ExecResult
- func (guest Guest) RpmInstall(packagePath string) error
- func (g Guest) RunFio(opts FioOptions) (string, error)
- func (guest Guest) RunIperf3(args ...string) ExecResult
- func (guest Guest) RunIperfClient(clientIp string, serverIp string, logfile string, options string) ExecResult
- func (guest Guest) RunIperfClientUdp(clientIp string, serverIp string, logfile string, options string) ExecResult
- func (guest Guest) RunIperfServer(serverIp string, logfile string, options string) ExecResult
- func (g Guest) String() string
- func (guest Guest) WithPing(targetIp string, interval float32, useInterface string, function func()) (string, string)
- type GuestConnection
- type GuestExecArguments
- type GuestExecStatusArguments
- type GuestFileCloseArguments
- type GuestFileOpenArguments
- type GuestFileWriteArguments
- type IperfReport
- type IperfReports
- type Job
- type NetQosTest
- type PPS
- type QGACExecStatus
- type QemuAgentCommand
- type QgaExecResult
- type QgaExecReturn
- type QgaExecStatusResult
- type QgaExecStatusReturn
- type QgaFileOpenReturn
- type QgaGFileClose
- type QgaGFileOpen
- type QgaGFileWrite
- type QgaWriteOpenReturn
- type QgaWriteOpenReturnArguments
Constants ¶
View Source
const GB = Gb * 8
View Source
const Gb = Mb * 1000
View Source
const MB = Mb * 8
View Source
const Mb = 1000
View Source
const TB = Tb * 8
View Source
const Tb = Gb * 1000
Variables ¶
This section is empty.
Functions ¶
func ParseBandwidth ¶
Types ¶
type Bandwidth ¶
func (Bandwidth) HumanBandwidth ¶
type BlockDevice ¶
type BlockDevices ¶
type BlockDevices []BlockDevice
func (BlockDevices) GetAllNames ¶
func (b BlockDevices) GetAllNames() []string
type FioOptions ¶
type FioTest ¶
type FioTest struct {
Guest Guest
Options FioOptions
}
type Guest ¶
type Guest struct {
Connection string
Domain string
ByUUID bool
QGATimeout int
// contains filtered or unexported fields
}
func ParseGuest ¶
func (Guest) Cat ¶
func (guest Guest) Cat(args ...string) ExecResult
func (Guest) ConnectToQGA ¶
func (Guest) GetBlockDevices ¶
func (guest Guest) GetBlockDevices() (BlockDevices, error)
func (Guest) GetExecStatusOutput ¶
guest-exec-status
func (Guest) GetIpaddrs ¶
func (Guest) HasCommand ¶
func (Guest) RpmInstall ¶
func (Guest) RunIperfClient ¶
func (Guest) RunIperfClientUdp ¶
func (Guest) RunIperfServer ¶
func (guest Guest) RunIperfServer(serverIp string, logfile string, options string) ExecResult
type GuestConnection ¶
type GuestExecArguments ¶
type GuestExecStatusArguments ¶
type GuestExecStatusArguments struct {
Pid int `json:"pid"`
}
type GuestFileCloseArguments ¶
type GuestFileCloseArguments struct {
Handle int `json:"handle"`
}
type GuestFileOpenArguments ¶
type GuestFileWriteArguments ¶
type IperfReport ¶
func NewIperfReport ¶
func NewIperfReport(source string, dest string, data string) *IperfReport
func (IperfReport) GetBpsSum ¶
func (r IperfReport) GetBpsSum() (*Bandwidth, *Bandwidth)
func (IperfReport) GetPpsSum ¶
func (r IperfReport) GetPpsSum() (*PPS, *PPS)
type IperfReports ¶
type IperfReports struct {
Reports []IperfReport
SendTotal Bandwidth
ReceiveTotal Bandwidth
}
func NewIperfReports ¶
func NewIperfReports() *IperfReports
func (*IperfReports) Add ¶
func (reports *IperfReports) Add(source string, dest string, data string)
func (IperfReports) PrintBps ¶
func (reports IperfReports) PrintBps()
func (IperfReports) PrintPps ¶
func (reports IperfReports) PrintPps()
type NetQosTest ¶
type NetQosTest struct {
ClientGuest Guest
ServerGuest Guest
PPS bool
LocalIperf3File string
ClientOptions string
ServerOptions string
}
使用 iperf3 工具测试网络BPS/PPS
参数为客户端和服务端实例的连接地址, 格式: "连接地址@实例 UUID". e.g.
192.168.192.168@a6ee919a-4026-4f0b-8d7e-404950a91eb3
type PPS ¶
func (PPS) GetLostPercent ¶
type QGACExecStatus ¶
type QGACExecStatus struct {
Execute string `json:"execute"`
Arguments GuestExecStatusArguments `json:"arguments"`
}
type QemuAgentCommand ¶
type QemuAgentCommand struct {
Execute string `json:"execute"`
Arguments GuestExecArguments `json:"arguments"`
}
type QgaExecResult ¶
type QgaExecResult struct {
Return QgaExecReturn `json:"return"`
}
type QgaExecReturn ¶
type QgaExecReturn struct {
Pid int `json:"pid"`
}
type QgaExecStatusResult ¶
type QgaExecStatusResult struct {
Return QgaExecStatusReturn `json:"return"`
}
type QgaExecStatusReturn ¶
type QgaFileOpenReturn ¶
type QgaFileOpenReturn struct {
Return int `json:"return"`
}
type QgaGFileClose ¶
type QgaGFileClose struct {
Execute string `json:"execute"`
Arguments GuestFileCloseArguments `json:"arguments"`
}
type QgaGFileOpen ¶
type QgaGFileOpen struct {
Execute string `json:"execute"`
Arguments GuestFileOpenArguments `json:"arguments"`
}
type QgaGFileWrite ¶
type QgaGFileWrite struct {
Execute string `json:"execute"`
Arguments GuestFileWriteArguments `json:"arguments"`
}
type QgaWriteOpenReturn ¶
type QgaWriteOpenReturn struct {
Return QgaWriteOpenReturnArguments `json:"return"`
}
Click to show internal directories.
Click to hide internal directories.