Documentation
¶
Index ¶
- func RunClusterBenchFromCLI(logger *zap.SugaredLogger, args []string)
- func RunFromCLI(logger *zap.SugaredLogger, args []string)
- func RunKillBenchFromCLI(logger *zap.SugaredLogger, args []string)
- func RunMultiFromCLI(logger *zap.SugaredLogger, args []string)
- func StartLoadTest(logger *zap.SugaredLogger, host string, numAuthors, numLurkers int, ...)
- func StartMultiLoadTest(logger *zap.SugaredLogger, host string, maxPads int)
- type ClusterBenchConfig
- type ClusterBenchResult
- type KillBenchConfig
- type KillBenchResult
- type Latencies
- type Metrics
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 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
Latencies is a set of samples.