Documentation
¶
Overview ¶
Package client 实现 Pulse UDP 客户端。
Index ¶
- func Run(ctx context.Context, c Config) error
- func RunClientUDPStats(w io.Writer, tick time.Duration, testStart time.Time, mainDur time.Duration, ...)
- func TestAutoGeneratedTestID_ErrorHandling(t *testing.T)
- func TestAutoGeneratedTestID_Format(t *testing.T)
- func TestResolveClientOutputPaths_BoundaryCases(t *testing.T)
- func TestResolveClientOutputPaths_DefaultOutputRoot(t *testing.T)
- func TestResolveClientOutputPaths_DirectoryCreation(t *testing.T)
- func TestSendULAndRecvDL(t *testing.T)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunClientUDPStats ¶
func RunClientUDPStats( w io.Writer, tick time.Duration, testStart time.Time, mainDur time.Duration, ulPPS, dlPPS int64, dlSpacingNs int64, bucket *statwindow.SumBucket, )
RunClientUDPStats 在主测试时长内按 tick 打印 iperf3 UDP 风格 [SUM] 行;DL 入站抖动与丢包。
func TestAutoGeneratedTestID_ErrorHandling ¶
测试 autoGeneratedTestID 函数的错误处理
func TestAutoGeneratedTestID_Format ¶
测试 autoGeneratedTestID 函数的格式
func TestResolveClientOutputPaths_BoundaryCases ¶
测试 resolveClientOutputPaths 函数的边界情况
func TestResolveClientOutputPaths_DefaultOutputRoot ¶
测试 resolveClientOutputPaths 函数的默认输出目录
func TestResolveClientOutputPaths_DirectoryCreation ¶
测试 resolveClientOutputPaths 函数的目录创建
Types ¶
type Config ¶
type Config struct {
ServerAddr string
SourceAddr string // 源地址(可选,默认使用系统默认地址)
Size int
ULBandwidth string
DLBandwidth string
Duration time.Duration
SampleInterval time.Duration
GracePeriod time.Duration
TimeDeltaNs int64
TestID string // 为空时 Run 内自动生成 YYYYMMDDTHHmmss_xxxxxx(与 20260306T201103 同类 + 下划线六位 hex 随机)
// OutputRoot 输出根目录;其下创建 {TestID}/,写入 client.csv 与 config.json。空字符串在 Run 内按 "results" 处理。
OutputRoot string
Logger *slog.Logger
// StatsInterval 周期打印间隔(iperf3 UDP 风格表);<=0 关闭。与 SampleInterval(merge 分桶)独立。
StatsInterval time.Duration
// StatsWriter 周期表输出目标;StatsInterval>0 且为 nil 时使用 os.Stdout。
StatsWriter io.Writer
}
Config 客户端一次测试参数。
Source Files
¶
- client.go
- client_test_config.go
- client_test_integration.go
- udp_stats.go
Click to show internal directories.
Click to hide internal directories.