echo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package echo is the calibrated target used by Stampede's accuracy benchmark. Each response is delayed by a value drawn from a known distribution, and the server records exactly how long it held every request, so a load generator's reported percentiles can be compared with ground truth.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDist

func ParseDist(s string) (dist, error)

ParseDist parses a delay distribution spec.

Types

type Server

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

Server is a calibrated echo handler.

func New

func New(spec string, seed uint64) (*Server, error)

New builds a server for a distribution spec such as "lognormal:20ms:0.5".

func (*Server) Reset

func (s *Server) Reset()

Reset clears recorded hold times.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

func (*Server) Stats

func (s *Server) Stats() Stats

Stats returns exact percentiles of how long requests were held.

type Stats

type Stats struct {
	Count int     `json:"count"`
	P50   float64 `json:"p50"`
	P90   float64 `json:"p90"`
	P95   float64 `json:"p95"`
	P99   float64 `json:"p99"`
	P999  float64 `json:"p999"`
	Max   float64 `json:"max"`
	Mean  float64 `json:"mean"`
}

Stats are exact percentiles of how long the server held requests.

Jump to

Keyboard shortcuts

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