faregate: github.com/matttproud/faregate/cmd/example Files

Command example

Example is a HTTP server that respondes to requests on /limited according to the provided token bucket policy.

$ go run example.go -limit=60 &
$ ab -n5000 -c5 http://localhost:6060/limited

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests

Server Software:
Server Hostname:        localhost
Server Port:            6060

Document Path:          /limited
Document Length:        0 bytes

Concurrency Level:      5
Time taken for tests:   82.328 seconds
Complete requests:      5000
Failed requests:        0
Total transferred:      580000 bytes
HTML transferred:       0 bytes
Requests per second:    60.73 [#/sec] (mean)
Time per request:       82.328 [ms] (mean)
Time per request:       16.466 [ms] (mean, across all concurrent requests)
Transfer rate:          6.88 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     0   82  73.4     66     900
Waiting:        0   82  73.4     66     900
Total:          0   82  73.4     66     900

Percentage of the requests served within a certain time (ms)
  50%     66
  66%     83
  75%    116
  80%    133
  90%    183
  95%    233
  98%    300
  99%    350
 100%    900 (longest request)

Package Files

main.go

Package main imports 4 packages (graph). Updated 2016-07-19. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).