Skip to content

Unleash/golang-perf-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spike Reproduction Test

Test suite for reproducing and measuring P99.9 latency spikes in the Unleash Go SDK under high-concurrency conditions.

Prerequisites

  • Go 1.23+
  • Access to an Unleash server
  • A valid API token

Configuration

The tests can be configured via environment variables:

Variable Default Description
UNLEASH_URL yoururl Unleash API URL
UNLEASH_API_TOKEN yourtoken Your Unleash API token
UNLEASH_APP_NAME p999-spike-test Application name for the client
FEATURE_NAME yourfeature Feature flag to evaluate

Running the Tests

Run all tests

go test -v

Run the burst test

Tests latency by firing concurrent bursts of requests:

go test -v -run TestP999LatencySpike

This test:

  • Fires bursts of 1000 workers × 100 calls = 100,000 requests per burst
  • Runs for 4 minutes with bursts every 2 seconds
  • Reports percentile latencies (P50, P95, P99, P99.9, P99.99)
  • Flags spikes when P99.9 exceeds 10ms

Run the continuous load test

Tests latency under sustained high-concurrency traffic:

go test -v -run TestContinuousHighConcurrency

With configurable GOGC:

GOGC=400 go test -v -run TestContinuousHighConcurrency

This test:

  • Maintains 1000 concurrent workers making continuous requests
  • Runs for 4 minutes
  • Reports per-second windows with elevated latencies

With custom configuration

UNLEASH_URL=http://localhost:4242/api \
UNLEASH_API_TOKEN=your-token \
FEATURE_NAME=my-feature \
go test -v -run TestP999LatencySpike

With configurable GOGC:

UNLEASH_URL=http://localhost:4242/api \
UNLEASH_API_TOKEN=your-token \
FEATURE_NAME=my-feature \
GOGC=400 go test -v -run TestP999LatencySpike

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages