https://github.com/sysulq/ratelimitx
A simple ratelimit for golang, implemented with memcache and gobreak, aims on high availability.
https://github.com/sysulq/ratelimitx
circuit-breaker gobreak golang memcached ratelimit
Last synced: 6 months ago
JSON representation
A simple ratelimit for golang, implemented with memcache and gobreak, aims on high availability.
- Host: GitHub
- URL: https://github.com/sysulq/ratelimitx
- Owner: sysulq
- License: mit
- Created: 2018-01-04T11:54:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-22T01:34:06.000Z (over 7 years ago)
- Last Synced: 2025-02-13T04:47:15.052Z (8 months ago)
- Topics: circuit-breaker, gobreak, golang, memcached, ratelimit
- Language: Go
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ratelimitx
[](https://travis-ci.org/hnlq715/ratelimitx)
[](https://codecov.io/gh/hnlq715/ratelimitx)A simple ratelimit for golang, implemented with memcache and gobreak, aims on high availability.
test results
===
```
PASS
coverage: 85.2% of statements
ok ratelimitx 1.811s
Success: Tests passed.
```benchmark results
===
```
$ go test -bench=.
goos: windows
goarch: amd64
pkg: ratelimitx
BenchmarkAllowSecond-4 5000 253200 ns/op
BenchmarkAllowMinute-4 5000 237330 ns/op
BenchmarkAllowHour-4 10000 247800 ns/op
BenchmarkMemcacheUnavailableWithFallback-4 1000000 1075 ns/op
BenchmarkMemcacheUnavailableWithoutFallback-4 2000000 918 ns/op
PASS
ok go_third_party/app/lib/ratelimitx 12.950s
```