loadtest

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Loadtest

This is the loadtest known in the original Etherpad as Etherpad load test. The arguments changed so please run ./etherpad-go loadtest --help to see the available options.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunClusterBenchFromCLI added in v0.7.0

func RunClusterBenchFromCLI(logger *zap.SugaredLogger, args []string)

RunClusterBenchFromCLI runs "etherpad-go clusterbench".

func RunFromCLI

func RunFromCLI(logger *zap.SugaredLogger, args []string)

func RunKillBenchFromCLI added in v0.7.0

func RunKillBenchFromCLI(logger *zap.SugaredLogger, args []string)

RunKillBenchFromCLI runs "etherpad-go killbench".

func RunMultiFromCLI

func RunMultiFromCLI(logger *zap.SugaredLogger, args []string)

func StartLoadTest

func StartLoadTest(logger *zap.SugaredLogger, host string, numAuthors, numLurkers int, duration int, loadUntilFail bool)

func StartMultiLoadTest

func StartMultiLoadTest(logger *zap.SugaredLogger, host string, maxPads int)

Types

type ClusterBenchConfig added in v0.7.0

type ClusterBenchConfig struct {
	// Hosts are the base URLs of the Etherpad instances, e.g.
	// http://pod-1:9001. Clients are spread over them round-robin.
	Hosts []string
	// Pad is the pad to edit; a random one when empty.
	Pad string
	// Authors is the number of clients that write.
	Authors int
	// Duration is how long the authors write.
	Duration time.Duration
	// Interval is the pause between two changes of one author.
	Interval time.Duration
	// PrefillBytes makes the pad that large before the measurement starts,
	// to see what pad size costs.
	PrefillBytes int
	// Settle is how long to wait after the last change before the final
	// comparison.
	Settle time.Duration
}

ClusterBenchConfig configures RunClusterBench.

type ClusterBenchResult added in v0.7.0

type ClusterBenchResult struct {
	Commits int
	// CommitLatency is the time from sending a change to its ACCEPT_COMMIT.
	CommitLatency Latencies
	// SamePod and CrossPod are the times until an observer saw a change,
	// for observers on the author's instance and on other instances.
	SamePod  Latencies
	CrossPod Latencies
	// Timeouts are changes without ACCEPT_COMMIT within 10 seconds.
	Timeouts  int
	OutOfSync int
	// Lost and Duplicated are accepted changes missing from, or appearing
	// more than once in, an instance's export of the pad.
	Lost       []string
	Duplicated []string
	// Divergent lists instances whose export differs from the first one's.
	Divergent []string
}

ClusterBenchResult is what RunClusterBench measured.

func RunClusterBench added in v0.7.0

func RunClusterBench(logger *zap.SugaredLogger, cfg ClusterBenchConfig) (*ClusterBenchResult, error)

RunClusterBench writes to one pad through several Etherpad instances and measures latencies and whether every accepted change ends up exactly once in the pad on every instance.

func (*ClusterBenchResult) Failed added in v0.7.0

func (r *ClusterBenchResult) Failed() bool

Failed reports whether the run found lost or inconsistent data.

func (*ClusterBenchResult) String added in v0.7.0

func (r *ClusterBenchResult) String() string

type KillBenchConfig added in v0.7.0

type KillBenchConfig struct {
	// Victim is the instance the authors write through; it is killed.
	Victim string
	// Survivors are the instances the authors reconnect to, like a load
	// balancer picking another pod.
	Survivors []string
	// VictimPID is the process killed with SIGKILL after KillAfter.
	VictimPID int
	// KillCommand, if set instead, is run with sh -c after KillAfter, e.g.
	// "kubectl delete pod etherpad-0" (graceful) or with --grace-period=0
	// --force (hard). Its exit status decides whether the kill counts.
	KillCommand string
	KillAfter   time.Duration
	Pad         string
	Authors     int
	// Duration is how long the authors write, from the start.
	Duration time.Duration
	Interval time.Duration
	Settle   time.Duration
}

KillBenchConfig configures RunKillBench.

type KillBenchResult added in v0.7.0

type KillBenchResult struct {
	Sent, Accepted int
	// AcceptedAfterKill counts changes acknowledged after the kill: they
	// went through the survivors.
	AcceptedAfterKill int
	// Unacknowledged are changes no instance acknowledged in time.
	Unacknowledged []string
	// Lost are acknowledged changes missing from the pad.
	Lost []string
	// Duplicated are changes found more than once.
	Duplicated []string
	// Failover is the longest time an author waited for an
	// acknowledgement across the kill.
	Failover time.Duration
	Killed   bool
}

KillBenchResult reports what happened to the changes around the kill.

func RunKillBench added in v0.7.0

func RunKillBench(logger *zap.SugaredLogger, cfg KillBenchConfig) (*KillBenchResult, error)

RunKillBench writes through the victim, kills it mid-typing and checks that the authors carry on through the survivors without losing or duplicating a change.

func (*KillBenchResult) Failed added in v0.7.0

func (r *KillBenchResult) Failed() bool

Failed reports whether a change was lost, duplicated or never stored.

func (*KillBenchResult) String added in v0.7.0

func (r *KillBenchResult) String() string

type Latencies added in v0.7.0

type Latencies []time.Duration

Latencies is a set of samples.

func (Latencies) Percentile added in v0.7.0

func (l Latencies) Percentile(p float64) time.Duration

func (Latencies) String added in v0.7.0

func (l Latencies) String() string

type Metrics

type Metrics struct {
	ClientsConnected  int64
	AuthorsConnected  int64
	LurkersConnected  int64
	AppendSent        int64
	ErrorCount        int64
	AcceptedCommit    int64
	ChangeFromServer  int64
	NumConnectedUsers int64 // From server
	StartTime         time.Time
}

Jump to

Keyboard shortcuts

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