echo

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 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.

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