Skip to content

rodaine/x-files-rate

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

x-files-rate

An example program for the blog post The X-Files: Controlling Throughput with rate.Limiter, demonstrating various techniques for rate limiting an HTTP service via middleware.

Use

Bootstrap

go get github.com/rodaine/x-files-rate

Run

Each rate-limiting middleware can be tested with ever-increasing RPS via vegeta using a customized vegeta test harness. The target names for the middleware can be found in middleware.go. Results are printed to stdout and also stored in ./results/{{target}}.csv.

./run.sh        # defaults to no rate-limiter
./run.sh ticker # targets the "ticker" middleware 

Plot

The output CSV can be converted to SVG graphs using gnuplot. The SVG files are persisted in ./results/plots/{{target}}.svg.

./plot.sh ticker

About

golang.org/x/time/rate example application

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published