schedule

package
v0.1.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MulanPSL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package schedule 实现 README 中的整数 pps、interval_ns、实际带宽与总包数。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TotalPackets

func TotalPackets(pps int64, d time.Duration) int64

TotalPackets 在时长 d 内按 pps 发送时的总包数(四舍五入到最近整数)。

Types

type Plan

type Plan struct {
	TargetBps   float64
	PayloadSize int
	PPS         int64
	ActualBps   float64
	IntervalNs  int64
}

Plan 描述某一方向上的发包计划。

func FromBandwidth

func FromBandwidth(targetBps float64, payloadBytes int) (Plan, error)

FromBandwidth 根据目标带宽(bps)与 payload 字节数计算发包计划。

Source Files

  • schedule.go

Jump to

Keyboard shortcuts

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