Documentation
¶
Index ¶
- Constants
- Variables
- func StopTCPServe() error
- func TCPSendServe(Addr string, duration time.Duration) error
- func TCPSendServeWithContext(ctx context.Context, Addr string, duration time.Duration) error
- type ConnType
- type CtrlHeader
- type CtrlType
- type Fperf
- type RoleType
- type TCPInfo
- type TcpPerfServer
- type TcpResult
Constants ¶
View Source
const CtrlHeaderLen = 12 //Byte
View Source
const FirstDataLen = 5
View Source
const RWBufferSize = 1048576
Variables ¶
View Source
var TCPListener net.Listener
Functions ¶
func StopTCPServe ¶
func StopTCPServe() error
Types ¶
type CtrlHeader ¶
func PacketFromReader ¶
func PacketFromReader(r io.Reader) (*CtrlHeader, error)
func (*CtrlHeader) Pack ¶
func (h *CtrlHeader) Pack() []byte
type Fperf ¶
type Fperf struct { Conn net.Conn CtrlConn net.Conn TestDuration time.Duration Stat *freconn.Stat PeerStat *freconn.Stat Role RoleType Finish bool }
func NewReceiver ¶
func (*Fperf) GetPeerStat ¶
func (*Fperf) RunReceiver ¶
type TcpPerfServer ¶
type TcpPerfServer struct {
Addr string
}
type TcpResult ¶
type TcpResult struct { // TCP信息 TCPInfo *TCPInfo // 发送的总数据量(bit) SendTotal uint64 // 对端接收的总数据量(bit) RecvTotal uint64 // 测试时间(second) Time int64 // 重传量 Retrans uint32 Dura time.Duration }
func TCPClientRecv ¶
func TCPClientRecvCompatible ¶
TCPClientRecvCompatible 测试TCP性能(客户端)
func (*TcpResult) RetransPercents ¶
RetransPercents 重传率,若要以%表示需要额外*100
Click to show internal directories.
Click to hide internal directories.