Advanced Echo Server Logo

Advanced Echo Server

Go-powered testing, load simulation & chaos engineering

Delay Features

Simulate network conditions with delay patterns controlled via HTTP headers or environment variables. Delays are capped at 300s to prevent hangs. Prometheus histograms track latency.

Control Flow

graph TD
  A[Request] --> B{Check Headers/Env}
  B -->|X-Echo-Delay| C[Simple Delay]
  B -->|X-Echo-Jitter| D[Jitter Delay]
  B -->|X-Echo-Random-Delay| E[Random Delay]
  B -->|X-Echo-Exponential| F[Exponential Backoff]
  B -->|X-Echo-Latency| G[Latency Injection]
  C --> H[Apply Delay]
  D --> H
  E --> H
  F --> H
  G --> H
  H --> I[Continue Processing]

Simple Delay

Applies a fixed delay in milliseconds.

curl -H "X-Echo-Delay: 200ms" http://localhost:8080/ -d "test"
# Logs: "Simple delay: 200ms"

Jitter Delay

Base delay ± random variance (ms).

curl -H "X-Echo-Jitter: 100,50" http://localhost:8080/
# Logs: "Jitter delay: 120ms (base: 100ms, jitter: 20ms)"

Random Delay

Uniform random delay in a range (ms).

curl -H "X-Echo-Random-Delay: 100,300" http://localhost:8080/
# Logs: "Random delay: 150ms (range: 100-300)"

Exponential Backoff

Delay = base * 2^(attempt-1) + 25% jitter, for retry testing.

curl -H "X-Echo-Exponential: 100,3" http://localhost:8080/
# Logs: "Exponential delay: 410ms (base: 100ms, attempt: 3)"

Latency Injection

Fixed or random latency (ms).

curl -H "X-Echo-Latency: 100-200ms" http://localhost:8080/
# Logs: "Latency injection: 130ms (range: 100-200)"

Notes