bench

package
v0.17.4 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Clients = []string{"rtcbench", "webrtcperf", "chromium"}
View Source
var SFUs = pluginIDs()

Functions

func AppendTrial

func AppendTrial(dir string, trial Trial) error

func BrowserURL

func BrowserURL(c Cluster, t Topology, cell Cell, mode string) string

func LoadHints

func LoadHints(path, mode string) (map[string]int, error)

func SaveHints

func SaveHints(path, mode string, report Report) error

Types

type Analysis

type Analysis struct {
	Best        map[string]int `json:"best"`
	Experiments int            `json:"experiments"`
	Failures    []Trial        `json:"failures"`
}

func Analyze

func Analyze(reader io.Reader) (Analysis, error)

func (Analysis) Print

func (a Analysis) Print(w io.Writer) error

type Attempt

type Attempt struct {
	Load   int  `json:"load"`
	Passed bool `json:"passed"`
}

type Bounds

type Bounds struct {
	Min  int `json:"min"`
	Max  int `json:"max"`
	Hint int `json:"hint,omitempty"`
}

type Cell

type Cell struct {
	SFU    string `json:"sfu"`
	Client string `json:"client"`
}

func ParseCells

func ParseCells(value string) ([]Cell, error)

func (Cell) Key

func (c Cell) Key() string

type Cluster

type Cluster struct {
	SSHKey           string            `yaml:"ssh_key" json:"ssh_key"`
	SSHUser          string            `yaml:"ssh_user" json:"ssh_user"`
	Sender           string            `yaml:"sender,omitempty" json:"sender,omitempty"`
	Viewer           string            `yaml:"viewer,omitempty" json:"viewer,omitempty"`
	SFU              Hosts             `yaml:"sfu" json:"sfu"`
	Receivers        Hosts             `yaml:"receivers,omitempty" json:"receivers,omitempty"`
	Senders          Hosts             `yaml:"senders,omitempty" json:"senders,omitempty"`
	DataIPs          map[string]string `yaml:"data_ips,omitempty" json:"data_ips,omitempty"`
	JanusConfig      `yaml:",inline"`
	JitsiConfig      `yaml:",inline"`
	LiveKitConfig    `yaml:",inline"`
	MediasoupConfig  `yaml:",inline"`
	NICMbps          float64        `yaml:"nic_mbps,omitempty" json:"nic_mbps,omitempty"`
	VideoMbps        float64        `yaml:"video_bitrate_mbps" json:"video_bitrate_mbps"`
	InitialHi        map[string]int `yaml:"initial_hi,omitempty" json:"initial_hi,omitempty"`
	StartupSeconds   int            `yaml:"startup_timeout_seconds" json:"startup_timeout_seconds"`
	WarmupSeconds    int            `yaml:"warmup_seconds" json:"warmup_seconds"`
	DurationSeconds  int            `yaml:"steady_state_seconds" json:"steady_state_seconds"`
	StartLeadSeconds int            `yaml:"start_lead_seconds" json:"start_lead_seconds"`
	SampleSeconds    int            `yaml:"sample_seconds" json:"sample_seconds"`
	TeardownSeconds  int            `yaml:"teardown_seconds" json:"teardown_seconds"`
	MinBitrate       float64        `yaml:"min_bitrate_bps" json:"min_bitrate_bps"`
	MinFPS           float64        `yaml:"min_fps" json:"min_fps"`
	HealthyFraction  float64        `yaml:"healthy_fraction" json:"healthy_fraction"`
	Cores            string         `yaml:"cores,omitempty" json:"cores,omitempty"`
	RTCBenchImage    string         `yaml:"rtcbench_image" json:"rtcbench_image"`
	BrowserImage     string         `yaml:"webrtcperf_image" json:"webrtcperf_image"`
	RemoteIVF        string         `yaml:"remote_ivf_dir" json:"remote_ivf_dir"`
	VideoPath        string         `yaml:"video_path" json:"video_path"`
	BinariesDir      string         `yaml:"binaries_dir" json:"binaries_dir"`
	IVFDir           string         `yaml:"ivf_dir" json:"ivf_dir"`
}

func ParseCluster

func ParseCluster(data string) (Cluster, error)

func (Cluster) DataIP

func (c Cluster) DataIP(host string) string

func (Cluster) Hosts

func (c Cluster) Hosts() []string

type Hosts

type Hosts = benchmark.Hosts

type JanusConfig

type JanusConfig = janusbench.Config

type JitsiConfig

type JitsiConfig = jitsibench.Config

type LiveKitConfig

type LiveKitConfig = livekitbench.Config

type MediasoupConfig

type MediasoupConfig = mediasoupbench.Config

type Observation

type Observation struct {
	At      time.Time `json:"at"`
	Host    string    `json:"host"`
	Quality Quality   `json:"quality"`
}

type Options

type Options struct {
	Directory string
	ID        string
	Log       io.Writer
	Remote    Remote
	Execute   TrialExecutor
	Update    func(Report) error
}

type Quality

type Quality struct {
	Expected   int     `json:"expected"`
	Reported   int     `json:"reported"`
	Healthy    int     `json:"healthy"`
	Fraction   float64 `json:"fraction"`
	MinFPS     float64 `json:"minFPS"`
	MinBitrate float64 `json:"minBitrate"`
	Passed     bool    `json:"passed"`
	Reason     string  `json:"reason"`
}

func NativeQuality

func NativeQuality(reader io.Reader, expected int, cfg Cluster, since float64) (Quality, error)

type Remote

type Remote interface {
	Run(context.Context, string, string) (string, error)
	Write(context.Context, string, string, []byte) error
}

Remote implementations must support concurrent calls.

type Report

type Report struct {
	Simulated bool                    `json:"simulated"`
	Phase     string                  `json:"phase"`
	Results   map[string]SearchResult `json:"results"`
	Trials    []Trial                 `json:"trials"`
}

func Run

func Run(ctx context.Context, request Request, options Options) (Report, error)

type Request

type Request struct {
	Name         string         `json:"name"`
	ClusterYAML  string         `json:"cluster"`
	Mode         string         `json:"mode"`
	Cells        []Cell         `json:"cells"`
	Bounds       Bounds         `json:"bounds"`
	Repetitions  int            `json:"repetitions"`
	Provision    bool           `json:"provision"`
	UploadAssets bool           `json:"uploadAssets"`
	DryRun       bool           `json:"dryRun"`
	Hints        map[string]int `json:"hints,omitempty"`
}

func (Request) Validate

func (r Request) Validate() (Cluster, error)

type RoomGroup

type RoomGroup struct {
	Offset int `json:"offset"`
	Rooms  int `json:"rooms"`
	Users  int `json:"usersPerRoom"`
}

type SSH

type SSH struct{ Key, User string }

func (SSH) Run

func (s SSH) Run(ctx context.Context, host, command string) (string, error)

func (SSH) Stream

func (s SSH) Stream(ctx context.Context, host, command string, output io.Writer) error

func (SSH) Upload

func (s SSH) Upload(ctx context.Context, host, destination string, content io.Reader, executable bool) error

func (SSH) Write

func (s SSH) Write(ctx context.Context, host, path string, data []byte) error

type SearchResult

type SearchResult struct {
	Complete       bool      `json:"complete"`
	Limit          int       `json:"limit"`
	LimitReason    string    `json:"limitReason"`
	Best           int       `json:"best"`
	CeilingReached bool      `json:"ceilingReached"`
	Attempts       []Attempt `json:"attempts"`
}
func Search(ctx context.Context, bounds Bounds, test func(context.Context, int) (bool, error)) (SearchResult, error)

type Topology

type Topology struct {
	Load            int         `json:"loadPerMachine"`
	Rooms           int         `json:"rooms"`
	PerRoom         int         `json:"limitPerRoom"`
	TotalSenders    int         `json:"totalSenders"`
	TotalReceivers  int         `json:"totalReceivers"`
	ExpectedStreams int         `json:"expectedStreams"`
	Workers         []string    `json:"workers"`
	Observer        string      `json:"observer"`
	SFUIP           string      `json:"sfuIP"`
	Groups          []RoomGroup `json:"groups"`
}

func Layout

func Layout(c Cluster, mode, sfu string, load int) (Topology, error)

type Trial

type Trial struct {
	Cell
	Load        int           `json:"load"`
	Repeat      int           `json:"repeat"`
	Repetitions int           `json:"repetitions"`
	StartedAt   time.Time     `json:"startedAt"`
	EndedAt     time.Time     `json:"endedAt"`
	Passed      bool          `json:"passed"`
	Reason      string        `json:"reason"`
	Error       string        `json:"error,omitempty"`
	Topology    Topology      `json:"topology"`
	Samples     []Observation `json:"samples"`
	Artifacts   string        `json:"artifacts"`
}

type TrialExecutor

type TrialExecutor func(context.Context, TrialSpec) (Trial, error)

type TrialSpec

type TrialSpec struct {
	Cell
	Topology        Topology
	Repeat          int
	Directory       string
	RemoteDirectory string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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