core

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersionV1            = "rtcbench/v1"
	KindVideoCallStressTest = "VideoCallStressTest"
)
View Source
const ChurnScenarioID = "churn"
View Source
const DefaultScenarioID = "default"

Variables

View Source
var (
	ErrUnsupportedRole       = errors.New("unsupported role")
	ErrUnsupportedCapability = errors.New("unsupported capability")
	ErrCannotJoinRoom        = errors.New("cannot join room")
	ErrConnectionNotJoined   = errors.New("connection not joined")
	ErrUnknownPlugin         = errors.New("unknown plugin")
	ErrUnknownScenario       = errors.New("unknown scenario")
	ErrConnectionExists      = errors.New("connection already exists")
	ErrUserExists            = errors.New("user already exists")
	ErrUserClosed            = errors.New("user is closed")
	ErrMissingRoomID         = errors.New("missing room id")
	ErrImpairmentUnsupported = errors.New("plugin does not support network impairment")
)
View Source
var (
	ErrMissingAPIVersion = errors.New("missing apiVersion, expected " + APIVersionV1)
	ErrInvalidAPIVersion = errors.New("invalid apiVersion, expected " + APIVersionV1)
	ErrMissingKind       = errors.New("missing kind, expected " + KindVideoCallStressTest)
	ErrInvalidKind       = errors.New("invalid kind, expected " + KindVideoCallStressTest)

	ErrMissingMetadata = errors.New("missing metadata section")
	ErrMissingName     = errors.New("missing metadata.name string")
	ErrInvalidName     = errors.New("invalid metadata.name string")

	ErrMissingSpec           = errors.New("missing spec section")
	ErrMissingPlugin         = errors.New("missing spec.plugin string")
	ErrInvalidPlugin         = errors.New("invalid spec.plugin string")
	ErrInvalidScenario       = errors.New("invalid spec.scenario string")
	ErrInvalidScenarioConfig = errors.New("invalid spec.scenarioConfig section")
	ErrMissingConference     = errors.New("missing spec.conference section")
	ErrMissingNetwork        = errors.New("missing spec.network section")
	ErrMissingLogging        = errors.New("missing spec.logging section")

	ErrMissingConferenceName   = errors.New("missing spec.conference.name string")
	ErrInvalidConferenceName   = errors.New("invalid spec.conference.name string")
	ErrMissingUsersPerRoom     = errors.New("missing spec.conference.usersPerRoom integer")
	ErrNonPositiveUsersPerRoom = errors.New("invalid spec.conference.usersPerRoom integer, must be >= 1")
	ErrNonPositiveTotalRooms   = errors.New("invalid spec.conference.totalRooms integer, must be >= 1")
	ErrMissingJoinPolicy       = errors.New("missing spec.conference.joinPolicy section")

	ErrMissingCameraCountPerRoom   = errors.New("missing spec.conference.cameras.perRoom integer")
	ErrInvalidCameraCountPerRoom   = errors.New("invalid spec.conference.cameras.perRoom integer, must be >= 0")
	ErrMissingCameraFileType       = errors.New("missing spec.conference.cameras.fileType string")
	ErrUnsupportedCameraFileType   = errors.New("unsupported spec.conference.cameras.fileType string")
	ErrMissingCameraVideoCodec     = errors.New("missing spec.conference.cameras.videoCodec string")
	ErrUnsupportedCameraVideoCodec = errors.New("unsupported spec.conference.cameras.videoCodec string")
	ErrMissingCameraDirectory      = errors.New("missing spec.conference.cameras.directory string")

	ErrMissingJoinPolicyConcurrency  = errors.New("missing spec.conference.joinPolicy.concurrency integer")
	ErrNegativeJoinPolicyConcurrency = errors.New("invalid spec.conference.joinPolicy.concurrency, must be >= 0")
	ErrNegativeJoinStartSpacing      = errors.New("invalid spec.conference.joinPolicy.joinStartSpacing, must be >= 0")

	ErrInvalidStatsBufferSize        = errors.New("invalid spec.conference.statsBufferSize integer, must be in range [64..4096]")
	ErrInvalidSVCMode                = errors.New("invalid spec.conference.cameras.svc.mode, must be auto|on|off")
	ErrInvalidSVCSpatialLayers       = errors.New("invalid spec.conference.cameras.svc.spatialLayers, must be 1-3")
	ErrInvalidSVCTemporalLayers      = errors.New("invalid spec.conference.cameras.svc.temporalLayers, must be 1-3")
	ErrMissingRecordingDirectory     = errors.New("missing spec.conference.recording.directory pathname")
	ErrMissingPacketCaptureDirectory = errors.New("missing spec.conference.packetCapture.directory pathname")

	ErrMissingServerIP   = errors.New("missing spec.network.serverIP address")
	ErrInvalidServerIP   = errors.New("invalid spec.network.serverIP address")
	ErrInvalidServerPort = errors.New("spec.network.serverPort must be in [1,65535]")
	ErrInvalidClientIP   = errors.New("invalid spec.network.clientIP address")

	ErrImpairmentProfilesEmpty            = errors.New("spec.network.impairment.profiles is empty")
	ErrImpairmentProfileNameEmpty         = errors.New("spec.network.impairment.profiles has an empty key")
	ErrImpairmentProfileBandwidthNeg      = errors.New("spec.network.impairment.profiles.*.bandwidthKbps must be >= 0")
	ErrImpairmentProfileLatencyNeg        = errors.New("spec.network.impairment.profiles.*.latency must be >= 0")
	ErrImpairmentProfileJitterNeg         = errors.New("spec.network.impairment.profiles.*.jitter must be >= 0")
	ErrImpairmentProfileLossRange         = errors.New("spec.network.impairment.profiles.*.lossPercent must be in [0,100]")
	ErrImpairmentDefaultMissing           = errors.New("spec.network.impairment.default is required")
	ErrImpairmentDefaultUnknown           = errors.New("spec.network.impairment.default references an unknown profile")
	ErrImpairmentAssignmentProfileEmpty   = errors.New("spec.network.impairment.assignments[*].profile is required")
	ErrImpairmentAssignmentProfileUnknown = errors.New("spec.network.impairment.assignments[*].profile references an unknown profile")
	ErrImpairmentAssignmentMatchEmpty     = errors.New("spec.network.impairment.assignments[*].match must set at least one selector")
	ErrImpairmentAssignmentRoleInvalid    = errors.New("spec.network.impairment.assignments[*].match.role must be 'sender' or 'viewer'")
	ErrImpairmentAssignmentPatternInvalid = errors.New("spec.network.impairment.assignments[*].match.userIDPattern must be a valid glob")
	ErrImpairmentAssignmentIndexRange     = errors.New("spec.network.impairment.assignments[*].match.userIndexRange must be [min,max] with min<=max or max=-1")

	ErrMissingLoggingDirectory = errors.New("missing spec.logging.directory pathname")
	ErrInvalidConsoleLevel     = errors.New("invalid spec.logging.consoleLevel string, must match " + logLevelRegex.String())
	ErrInvalidFileLevel        = errors.New("invalid spec.logging.fileLevel string, must match " + logLevelRegex.String())
	ErrInvalidMetricsThreshold = errors.New("invalid spec.metrics.thresholds section")

	ErrMissingLogStreamName  = errors.New("missing spec.logging.streams[#].name string")
	ErrInvalidLogStreamName  = errors.New("invalid spec.logging.streams[#].name string")
	ErrMissingLogStreamLevel = errors.New("missing spec.logging.streams[#].level string")
	ErrInvalidLogStreamLevel = errors.New("invalid spec.logging.streams[#].level string, must match " + logLevelRegex.String())

	SupportedCameraVideoCodecs = []string{"vp9"}
	SupportedCameraFileTypes   = []string{"ivf"}
)

Functions

func EvaluateReceiverThresholds

func EvaluateReceiverThresholds(summaries []ReceiverSummary, thresholds []ReceiverThresholdConfig) error

func EvaluateRunThresholds

func EvaluateRunThresholds(summary RunMetricsSummary, thresholds []RunThresholdConfig) error

func LoadCamerasFromConfig

func LoadCamerasFromConfig(cfg CameraConfig) (*ivf.Cameras, error)

LoadCamerasFromConfig loads IVF camera files when senders are configured. Returns nil when perRoom is 0.

func SetupPacketCaptureDir

func SetupPacketCaptureDir(cfg PacketCaptureConfig) (string, error)

SetupPacketCaptureDir creates a timestamped directory for packet captures under the configured base directory. Returns the path, or empty string if packet capture is disabled.

Types

type AssignmentSelector

type AssignmentSelector struct {
	Role          string
	UserIDPattern string
	UserIndexMin  *int
	UserIndexMax  *int
}

type CameraConfig

type CameraConfig struct {
	PerRoom    int
	FileType   string
	VideoCodec string
	Directory  string
	InMemory   bool
	// MixedRole makes the PerRoom camera-holding participants act as full
	// conference participants (publish AND subscribe) rather than send-only.
	// Set PerRoom == usersPerRoom for an all-participants-send-and-receive
	// conference. Honored by the default scenario; LiveKit-only at the plugin
	// layer.
	MixedRole bool
	SVC       SVCCameraConfig
}

type ChurnScenario

type ChurnScenario struct{}

func (ChurnScenario) Run

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config, logRegistry *log.Registry) *Client

func (*Client) AddStatsConsumer

func (c *Client) AddStatsConsumer(fn func(vp9_stats.Period, vp9_stats.VideoQualitySample))

func (*Client) CreateUser

func (c *Client) CreateUser(_ context.Context, cfg *UserConfig) (*User, error)

func (*Client) GetUser

func (c *Client) GetUser(userID string) *User

func (*Client) JoinAllRooms

func (c *Client) JoinAllRooms(ctx context.Context) error

func (*Client) MetricsSnapshot

func (c *Client) MetricsSnapshot() RunMetricsSnapshot

func (*Client) MetricsSummary

func (c *Client) MetricsSummary() RunMetricsSummary

func (*Client) RegisterPlugin

func (c *Client) RegisterPlugin(pluginID string, factory PluginFactory)

func (*Client) RegisterScenario

func (c *Client) RegisterScenario(scenarioID string, factory ScenarioFactory)

func (*Client) RunScenario

func (c *Client) RunScenario(ctx context.Context, scenarioID string) error

func (*Client) SetupPlugin

func (c *Client) SetupPlugin(ctx context.Context, pluginID string) error

func (*Client) Shutdown

func (c *Client) Shutdown(ctx context.Context) error

func (*Client) ShutdownAll

func (c *Client) ShutdownAll(ctx context.Context) error

type ConferenceConfig

type ConferenceConfig struct {
	Name               string
	UsersPerRoom       int
	TotalRooms         int
	StatsBufferSize    int
	StatsInputChanSize int
	Cameras            CameraConfig
	JoinPolicy         JoinPolicyConfig
	Recording          RecordingConfig
	PacketCapture      PacketCaptureConfig
}

type Config

type Config struct {
	APIVersion string
	Kind       string
	Metadata   MetadataConfig
	Spec       SpecConfig
}

type ConnectionState

type ConnectionState int
const (
	StateNew ConnectionState = iota
	StateJoined
	StateLeft
	StateClosed
)

type DefaultScenario

type DefaultScenario struct{}

func (DefaultScenario) Run

type FreezeDetector

type FreezeDetector struct {
	// contains filtered or unexported fields
}

func NewFreezeDetector

func NewFreezeDetector(fpsThreshold float32, freezeThresholdMS int) *FreezeDetector

func (*FreezeDetector) Reset

func (d *FreezeDetector) Reset()

func (*FreezeDetector) Stats

func (d *FreezeDetector) Stats() (count int64, duration time.Duration)

func (*FreezeDetector) Update

func (d *FreezeDetector) Update(now time.Time, fps float32) (inFreeze bool, freezeEnded bool, duration time.Duration)

type GaugeSummary

type GaugeSummary struct {
	Scenario string
	Plugin   string
	Role     string
	Name     string
	Profile  string
	UserID   string
	Current  float64
	Peak     float64
}

type HistogramSnapshot

type HistogramSnapshot struct {
	Count        int64
	Sum          float64
	Min          float64
	Max          float64
	BucketBounds []float64
	BucketCounts []uint64
}

func (HistogramSnapshot) Mean

func (h HistogramSnapshot) Mean() float64

func (HistogramSnapshot) Quantile

func (h HistogramSnapshot) Quantile(q float64) float64

type HistogramSummary

type HistogramSummary struct {
	Scenario    string
	Plugin      string
	Role        string
	Name        string
	Count       int64
	MeanSeconds float64
	MinSeconds  float64
	MaxSeconds  float64
	P50Seconds  float64
	P95Seconds  float64
	P99Seconds  float64
}

type ImpairmentAssignment

type ImpairmentAssignment struct {
	Match   AssignmentSelector
	Profile string
}

type ImpairmentConfig

type ImpairmentConfig struct {
	Profiles    map[string]*ImpairmentProfile
	Assignments []ImpairmentAssignment
	Default     string
}

type ImpairmentProfile

type ImpairmentProfile struct {
	Name         string
	BandwidthBps int
	BaseLatency  time.Duration
	JitterStddev time.Duration
	LossPercent  int
	Seed         int64
}

type JoinPolicyConfig

type JoinPolicyConfig struct {
	Concurrency            int
	AlwaysRetryFailedJoins bool
	JoinStartSpacing       time.Duration
}

type JoinRequest

type JoinRequest struct {
	RoomID string
	Plugin string
}

type Labels

type Labels map[string]string

type LeaveRequest

type LeaveRequest struct {
	RoomID string
	Plugin string
}

func (*LeaveRequest) GetPlugin

func (r *LeaveRequest) GetPlugin() string

func (*LeaveRequest) GetRoomID

func (r *LeaveRequest) GetRoomID() string

type LogStreamConfig

type LogStreamConfig struct {
	Name  string
	Level string
}

type LoggingConfig

type LoggingConfig struct {
	Console      bool
	ConsoleLevel string
	Color        bool
	Directory    string
	FileLevel    string
	Combined     bool
	Streams      []LogStreamConfig
}

type MetadataConfig

type MetadataConfig struct {
	Name string
}

type MetricsCollector

type MetricsCollector interface {
	IncCounter(name string, value int64, labels Labels)
	ObserveHistogram(name string, value float64, labels Labels)
	SetGauge(name string, value float64, labels Labels)
}

type MetricsConfig

type MetricsConfig struct {
	Port               int
	StatsJSONLPath     string
	Thresholds         []RunThresholdConfig
	ReceiverThresholds []ReceiverThresholdConfig
}

type NetworkConfig

type NetworkConfig struct {
	ServerIP   string
	ServerPort int
	ClientIP   string
	Impairment *ImpairmentConfig
}

type OperationSummary

type OperationSummary struct {
	Scenario    string
	Plugin      string
	Role        string
	Operation   string
	Attempts    int64
	Successes   int64
	Failures    int64
	FailureRate float64
	MeanSeconds float64
	P50Seconds  float64
	P95Seconds  float64
	P99Seconds  float64
}

type PacketCaptureConfig

type PacketCaptureConfig struct {
	Enabled   bool
	Directory string
}

type Participant

type Participant interface {
	JoinRoom(ctx context.Context, req *JoinRequest) error
	LeaveRoom(ctx context.Context, req *LeaveRequest) error
	Close() error
}

type Plugin

type Plugin interface {
	Setup(ctx context.Context, e PluginEnv) error
	Shutdown(ctx context.Context) error
	NewParticipant(ctx context.Context, cfg *UserConfig) (Participant, error)
}

type PluginEnv

type PluginEnv interface {
	Config() *Config
	LogRegistry() *log.Registry
	StatsConsumers() []func(vp9_stats.Period, vp9_stats.VideoQualitySample)
	ImpairmentRouter() *pionutil.ImpairmentRouter
	ObserveReceiverRTT(userID string, rtt time.Duration)
}

type PluginFactory

type PluginFactory func() Plugin

type PluginRegistry

type PluginRegistry map[string]PluginFactory

type PublishVideoRequest

type PublishVideoRequest struct {
	RoomID string
	Plugin string
}

func (*PublishVideoRequest) GetPlugin

func (r *PublishVideoRequest) GetPlugin() string

func (*PublishVideoRequest) GetRoomID

func (r *PublishVideoRequest) GetRoomID() string

type ReceiverSummary

type ReceiverSummary struct {
	Scenario            string
	Plugin              string
	Role                string
	Profile             string
	UserID              string
	FreezeCount         int64
	FreezeDurationTotal float64
	FrameLossRatio      float64
	MeanBitrateBps      float64
	MeanFPS             float64
	MaxJitterUS         float64
	MeanRTTMS           float64
	MaxRTTMS            float64
	PliCount            int64
	NackCount           int64
}

type ReceiverThresholdConfig

type ReceiverThresholdConfig struct {
	Scenario          string
	Plugin            string
	Profile           string
	UserID            string
	MaxFreezeCount    *int64
	MaxFreezeDuration *float64
	MaxFrameLossRatio *float64
	MinBitrateBps     *float64
	MinFPS            *float64
	MaxJitterUS       *float64
	MaxMeanRTTMS      *float64
	MaxPLICount       *int64
}

type ReceiverThresholdFailure

type ReceiverThresholdFailure struct {
	Threshold ReceiverThresholdConfig
	Actual    ReceiverSummary
	Reason    string
}

func (ReceiverThresholdFailure) Error

func (f ReceiverThresholdFailure) Error() string

type RecordingConfig

type RecordingConfig struct {
	Enabled   bool
	Directory string
}

type RunMetricsSnapshot

type RunMetricsSnapshot struct {
	Counters   map[string]int64
	Gauges     map[string]float64
	GaugePeaks map[string]float64
	Histograms map[string]HistogramSnapshot
	Receivers  []ReceiverSummary
}

func (RunMetricsSnapshot) CounterValue

func (s RunMetricsSnapshot) CounterValue(name string, labels Labels) int64

func (RunMetricsSnapshot) GaugePeakValue

func (s RunMetricsSnapshot) GaugePeakValue(name string, labels Labels) float64

func (RunMetricsSnapshot) GaugeValue

func (s RunMetricsSnapshot) GaugeValue(name string, labels Labels) float64

func (RunMetricsSnapshot) Histogram

func (s RunMetricsSnapshot) Histogram(name string, labels Labels) HistogramSnapshot

func (RunMetricsSnapshot) Summary

type RunMetricsSummary

type RunMetricsSummary struct {
	Operations []OperationSummary
	Sessions   []HistogramSummary
	Gauges     []GaugeSummary
	Receivers  []ReceiverSummary
}

type RunThresholdConfig

type RunThresholdConfig struct {
	Op             string
	Scenario       string
	Plugin         string
	Role           string
	MaxFailureRate *float64
	MaxMean        *time.Duration
	MaxP95         *time.Duration
	MaxP99         *time.Duration
}

type SVCCameraConfig

type SVCCameraConfig struct {
	Mode           string // "auto" (default), "on", "off"
	SpatialLayers  int    // 1-3 when Mode="on", 0 = auto-detect from IVF
	TemporalLayers int    // 1-3 when Mode="on", 0 = auto-detect from IVF
}

SVCCameraConfig controls VP9 SVC (Scalable Video Coding) behavior for senders.

  • Mode "auto": detect from IVF file. Non-SVC files use simple path, SVC files use SVC path.
  • Mode "on": force SVC path. SpatialLayers/TemporalLayers override auto-detection (0 = auto).
  • Mode "off": force simple path regardless of IVF file content.

type Scenario

type Scenario interface {
	Run(ctx context.Context, env ScenarioEnv) error
}

type ScenarioEnv

type ScenarioEnv interface {
	Config() *Config
	Client() *Client
	Log() *log.Logger
}

type ScenarioFactory

type ScenarioFactory func() Scenario

type ScenarioRegistry

type ScenarioRegistry map[string]ScenarioFactory

type SpecConfig

type SpecConfig struct {
	Plugin         string
	Scenario       string
	ScenarioConfig map[string]any
	Conference     ConferenceConfig
	Network        NetworkConfig
	PluginConfig   map[string]any
	Logging        LoggingConfig
	Metrics        MetricsConfig
}

type StatsPipeline

type StatsPipeline struct {
	ViewerManager *viewer.Manager
	Publisher     *vp9_stats.Publisher
}

StatsPipeline encapsulates the viewer manager and stats publisher that every plugin creates identically in Setup(). Use NewStatsPipeline in Setup and call Stop in Shutdown.

func NewStatsPipeline

func NewStatsPipeline(e PluginEnv) *StatsPipeline

NewStatsPipeline builds the stats channel, viewer manager, publisher, default log subscriber, and external consumers. It starts the publisher goroutine.

func (*StatsPipeline) Stop

func (sp *StatsPipeline) Stop()

Stop shuts down the viewer manager and publisher in the correct order.

type ThresholdFailure

type ThresholdFailure struct {
	Threshold RunThresholdConfig
	Actual    OperationSummary
	Reason    string
}

func (ThresholdFailure) Error

func (f ThresholdFailure) Error() string

type UnpublishVideoRequest

type UnpublishVideoRequest struct {
	RoomID string
	Plugin string
}

func (*UnpublishVideoRequest) GetPlugin

func (r *UnpublishVideoRequest) GetPlugin() string

func (*UnpublishVideoRequest) GetRoomID

func (r *UnpublishVideoRequest) GetRoomID() string

type User

type User struct {
	// contains filtered or unexported fields
}

func (*User) Close

func (u *User) Close() error

func (*User) JoinRoom

func (u *User) JoinRoom(ctx context.Context, req *JoinRequest) error

func (*User) LeaveRoom

func (u *User) LeaveRoom(ctx context.Context, req *LeaveRequest) error

func (*User) MetricsSnapshot

func (u *User) MetricsSnapshot() UserMetrics

func (*User) PublishVideo

func (u *User) PublishVideo(ctx context.Context, req *PublishVideoRequest) error

func (*User) UnpublishVideo

func (u *User) UnpublishVideo(ctx context.Context, req *UnpublishVideoRequest) error

type UserConfig

type UserConfig struct {
	UserID            string
	Role              UserRole
	ImpairmentProfile *ImpairmentProfile
}

type UserMetrics

type UserMetrics struct {
	JoinAttempts               int64
	JoinSuccesses              int64
	JoinFailures               int64
	JoinLatencyTotal           time.Duration
	LeaveAttempts              int64
	LeaveSuccesses             int64
	LeaveFailures              int64
	LeaveLatencyTotal          time.Duration
	PublishVideoAttempts       int64
	PublishVideoSuccesses      int64
	PublishVideoFailures       int64
	PublishVideoLatencyTotal   time.Duration
	UnpublishVideoAttempts     int64
	UnpublishVideoSuccesses    int64
	UnpublishVideoFailures     int64
	UnpublishVideoLatencyTotal time.Duration
	CloseAttempts              int64
	CloseSuccesses             int64
	CloseFailures              int64
	CloseLatencyTotal          time.Duration
}

type UserRole

type UserRole string
const (
	Viewer UserRole = "viewer"
	Sender UserRole = "sender"
	// Both is a mixed-role participant that simultaneously publishes its own
	// video (like Sender) and subscribes to every other participant (like
	// Viewer), i.e. a full conference participant. Currently wired for the
	// LiveKit plugin; other plugins return ErrUnsupportedRole.
	Both UserRole = "both"
)

type VideoPublisher

type VideoPublisher interface {
	PublishVideo(ctx context.Context, req *PublishVideoRequest) error
	UnpublishVideo(ctx context.Context, req *UnpublishVideoRequest) error
}

type YAMLAssignmentSelector

type YAMLAssignmentSelector struct {
	Role           *string `yaml:"role,omitempty"`
	UserIDPattern  *string `yaml:"userIDPattern,omitempty"`
	UserIndexRange *[2]int `yaml:"userIndexRange,omitempty"`
}

type YAMLCameraConfig

type YAMLCameraConfig struct {
	PerRoom    *int              `yaml:"perRoom,omitempty"`
	FileType   *string           `yaml:"fileType,omitempty"`
	VideoCodec *string           `yaml:"videoCodec,omitempty"`
	Directory  *string           `yaml:"directory,omitempty"`
	InMemory   *bool             `yaml:"inMemory,omitempty"`
	MixedRole  *bool             `yaml:"mixedRole,omitempty"`
	SVC        *YAMLSVCCamConfig `yaml:"svc,omitempty"`
}

type YAMLConferenceConfig

type YAMLConferenceConfig struct {
	// Name conference room identifier
	Name *string `yaml:"name,omitempty"`
	// UsersPerRoom number of users per conference room
	UsersPerRoom *int `yaml:"usersPerRoom,omitempty"`
	// TotalRooms defaults to 1
	TotalRooms *int `yaml:"totalRooms,omitempty"`
	// StatsBufferSize optional ring buffer size for video quality stats (default 768)
	StatsBufferSize *int `yaml:"statsBufferSize,omitempty"`
	// StatsInputChanSize optional channel buffer size for stats input (default 65536)
	StatsInputChanSize *int `yaml:"statsInputChanSize,omitempty"`
	// Cameras optional config for some (or all) users to turn on their cameras
	Cameras    *YAMLCameraConfig     `yaml:"cameras,omitempty"`
	JoinPolicy *YAMLJoinPolicyConfig `yaml:"joinPolicy,omitempty"`
	// Recording optional section, defaults to disabled
	Recording *YAMLRecordingConfig `yaml:"recording,omitempty"`
	// PacketCapture optional section, defaults to disabled
	PacketCapture *YAMLPacketCaptureConfig `yaml:"packetCapture,omitempty"`
}

type YAMLConfig

type YAMLConfig struct {
	APIVersion *string             `yaml:"apiVersion,omitempty"`
	Kind       *string             `yaml:"kind,omitempty"`
	Metadata   *YAMLMetadataConfig `yaml:"metadata,omitempty"`
	Spec       *YAMLSpecConfig     `yaml:"spec,omitempty"`
}

func (*YAMLConfig) IntoConfig

func (yc *YAMLConfig) IntoConfig() (*Config, error)

type YAMLImpairmentAssignment

type YAMLImpairmentAssignment struct {
	Match   YAMLAssignmentSelector `yaml:"match"`
	Profile string                 `yaml:"profile"`
}

type YAMLImpairmentConfig

type YAMLImpairmentConfig struct {
	Profiles    map[string]*YAMLImpairmentProfile `yaml:"profiles"`
	Assignments []YAMLImpairmentAssignment        `yaml:"assignments,omitempty"`
	Default     string                            `yaml:"default"`
}

type YAMLImpairmentProfile

type YAMLImpairmentProfile struct {
	BandwidthKbps *int    `yaml:"bandwidthKbps,omitempty"`
	Latency       *string `yaml:"latency,omitempty"`
	Jitter        *string `yaml:"jitter,omitempty"`
	LossPercent   *int    `yaml:"lossPercent,omitempty"`
	Seed          *int64  `yaml:"seed,omitempty"`
}

type YAMLJoinPolicyConfig

type YAMLJoinPolicyConfig struct {
	Concurrency            *int `yaml:"concurrency,omitempty"`
	AlwaysRetryFailedJoins bool `yaml:"alwaysRetryFailedJoins,omitempty"`
	// JoinStartSpacing optional duration parsed with time.ParseDuration (e.g. "2s")
	JoinStartSpacing *string `yaml:"joinStartSpacing,omitempty"`
}

type YAMLLogStreamConfig

type YAMLLogStreamConfig struct {
	Name  *string `yaml:"name,omitempty"`
	Level *string `yaml:"level,omitempty"`
}

type YAMLLoggingConfig

type YAMLLoggingConfig struct {
	Console      bool                  `yaml:"console"`
	ConsoleLevel *string               `yaml:"consoleLevel,omitempty"`
	Color        *bool                 `yaml:"color,omitempty"`
	Directory    *string               `yaml:"directory,omitempty"`
	FileLevel    *string               `yaml:"fileLevel,omitempty"`
	Combined     *bool                 `yaml:"combined,omitempty"`
	Streams      []YAMLLogStreamConfig `yaml:"streams,omitempty"`
}

type YAMLMetadataConfig

type YAMLMetadataConfig struct {
	Name *string `yaml:"name,omitempty"`
}

type YAMLMetricsConfig

type YAMLMetricsConfig struct {
	Port               *int                          `yaml:"port,omitempty"`
	StatsJSONLPath     *string                       `yaml:"statsJSONLPath,omitempty"`
	Thresholds         []YAMLRunThresholdConfig      `yaml:"thresholds,omitempty"`
	ReceiverThresholds []YAMLReceiverThresholdConfig `yaml:"receiverThresholds,omitempty"`
}

type YAMLNetworkConfig

type YAMLNetworkConfig struct {
	ServerIP   *string               `yaml:"serverIP,omitempty"`
	ServerPort *int                  `yaml:"serverPort,omitempty"`
	ClientIP   *string               `yaml:"clientIP,omitempty"`
	Impairment *YAMLImpairmentConfig `yaml:"impairment,omitempty"`
}

type YAMLPacketCaptureConfig

type YAMLPacketCaptureConfig struct {
	Enabled   *bool   `yaml:"enabled,omitempty"`
	Directory *string `yaml:"directory,omitempty"`
}

type YAMLReceiverThresholdConfig

type YAMLReceiverThresholdConfig struct {
	Scenario          *string  `yaml:"scenario,omitempty"`
	Plugin            *string  `yaml:"plugin,omitempty"`
	Profile           *string  `yaml:"profile,omitempty"`
	UserID            *string  `yaml:"userID,omitempty"`
	MaxFreezeCount    *int64   `yaml:"maxFreezeCount,omitempty"`
	MaxFreezeDuration *float64 `yaml:"maxFreezeDuration,omitempty"`
	MaxFrameLossRatio *float64 `yaml:"maxFrameLossRatio,omitempty"`
	MinBitrateBps     *float64 `yaml:"minBitrateBps,omitempty"`
	MinFPS            *float64 `yaml:"minFPS,omitempty"`
	MaxJitterUS       *float64 `yaml:"maxJitterUS,omitempty"`
	MaxMeanRTTMS      *float64 `yaml:"maxMeanRTTMS,omitempty"`
	MaxPLICount       *int64   `yaml:"maxPLICount,omitempty"`
}

type YAMLRecordingConfig

type YAMLRecordingConfig struct {
	Enabled   *bool   `yaml:"enabled,omitempty"`
	Directory *string `yaml:"directory,omitempty"`
}

type YAMLRunThresholdConfig

type YAMLRunThresholdConfig struct {
	Op             *string  `yaml:"op,omitempty"`
	Scenario       *string  `yaml:"scenario,omitempty"`
	Plugin         *string  `yaml:"plugin,omitempty"`
	Role           *string  `yaml:"role,omitempty"`
	MaxFailureRate *float64 `yaml:"maxFailureRate,omitempty"`
	MaxMean        *string  `yaml:"maxMean,omitempty"`
	MaxP95         *string  `yaml:"maxP95,omitempty"`
	MaxP99         *string  `yaml:"maxP99,omitempty"`
}

type YAMLSVCCamConfig

type YAMLSVCCamConfig struct {
	Mode           *string `yaml:"mode,omitempty"`
	SpatialLayers  *int    `yaml:"spatialLayers,omitempty"`
	TemporalLayers *int    `yaml:"temporalLayers,omitempty"`
}

type YAMLSpecConfig

type YAMLSpecConfig struct {
	Plugin         *string               `yaml:"plugin,omitempty"`
	Scenario       *string               `yaml:"scenario,omitempty"`
	ScenarioConfig map[string]any        `yaml:"scenarioConfig,omitempty"`
	Conference     *YAMLConferenceConfig `yaml:"conference,omitempty"`
	Network        *YAMLNetworkConfig    `yaml:"network,omitempty"`
	PluginConfig   map[string]any        `yaml:"pluginConfig,omitempty"`
	Logging        *YAMLLoggingConfig    `yaml:"logging,omitempty"`
	Metrics        *YAMLMetricsConfig    `yaml:"metrics,omitempty"`
}

Jump to

Keyboard shortcuts

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