mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
rate limiter now enabled from config
This commit is contained in:
parent
965dc59ffc
commit
0853d87fc3
2
main.go
2
main.go
@ -54,7 +54,7 @@ func main() {
|
|||||||
isDev := c.IsFromLocal()
|
isDev := c.IsFromLocal()
|
||||||
path := c.Path()
|
path := c.Path()
|
||||||
isRequestForStatic := strings.Contains(path, "/static") || strings.Contains(path, "/uploads") || strings.Contains(path, "/captcha")
|
isRequestForStatic := strings.Contains(path, "/static") || strings.Contains(path, "/uploads") || strings.Contains(path, "/captcha")
|
||||||
return isRequestForStatic || isDev
|
return (isRequestForStatic || isDev) && config.App.IsRateLimiterEnabled
|
||||||
},
|
},
|
||||||
Max: 50,
|
Max: 50,
|
||||||
}))
|
}))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
echo "GET http://localhost:3000" | vegeta attack -rate 100 -duration=120s | tee results.bin | vegeta report
|
echo "GET http://micrach.igonin.dev" | vegeta attack -rate 100 -duration=120s | tee results.bin | vegeta report
|
||||||
# vegeta report -type=json results.bin > metrics.json
|
# vegeta report -type=json results.bin > metrics.json
|
||||||
cat results.bin | vegeta plot > plot.html
|
cat results.bin | vegeta plot > plot.html
|
||||||
open plot.html
|
open plot.html
|
||||||
|
Loading…
Reference in New Issue
Block a user