-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Add Max Func to Limiter Middleware (#3070)
* feat: add max calculator to limiter middleware * docs: update docs including the new parameter * refactor: add new line before go code in docs * fix: use crypto/rand instead of math/rand on tests * test: add new test with zero set as limit * fix: repeated tests failing when generating random limits * fix: wrong type of MaxCalculator in docs * feat: include max calculator in limiter_sliding * refactor: rename MaxCalculator to MaxFunc * docs: update docs with MaxFunc parameter * tests: rename tests and add test for limiter sliding
- Loading branch information
1 parent
486304d
commit 011c8f8
Showing
5 changed files
with
174 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
011c8f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.50
.Benchmark_Ctx_Send
7.126
ns/op 0 B/op 0 allocs/op4.661
ns/op 0 B/op 0 allocs/op1.53
Benchmark_Ctx_Send - ns/op
7.126
ns/op4.661
ns/op1.53
Benchmark_Utils_GetOffer/1_parameter
205.8
ns/op 0 B/op 0 allocs/op136.1
ns/op 0 B/op 0 allocs/op1.51
Benchmark_Utils_GetOffer/1_parameter - ns/op
205.8
ns/op136.1
ns/op1.51
Benchmark_Utils_getGroupPath - allocs/op
4
allocs/op2
allocs/op2
Benchmark_Middleware_BasicAuth - B/op
80
B/op48
B/op1.67
Benchmark_Middleware_BasicAuth - allocs/op
5
allocs/op3
allocs/op1.67
Benchmark_Middleware_BasicAuth_Upper - B/op
80
B/op48
B/op1.67
Benchmark_Middleware_BasicAuth_Upper - allocs/op
5
allocs/op3
allocs/op1.67
Benchmark_CORS_NewHandler - B/op
16
B/op0
B/op+∞
Benchmark_CORS_NewHandler - allocs/op
1
allocs/op0
allocs/op+∞
Benchmark_CORS_NewHandlerSingleOrigin - B/op
16
B/op0
B/op+∞
Benchmark_CORS_NewHandlerSingleOrigin - allocs/op
1
allocs/op0
allocs/op+∞
Benchmark_CORS_NewHandlerPreflight
1170
ns/op 104 B/op 5 allocs/op759.2
ns/op 0 B/op 0 allocs/op1.54
Benchmark_CORS_NewHandlerPreflight - ns/op
1170
ns/op759.2
ns/op1.54
Benchmark_CORS_NewHandlerPreflight - B/op
104
B/op0
B/op+∞
Benchmark_CORS_NewHandlerPreflight - allocs/op
5
allocs/op0
allocs/op+∞
Benchmark_CORS_NewHandlerPreflightSingleOrigin
1162
ns/op 104 B/op 5 allocs/op757.5
ns/op 0 B/op 0 allocs/op1.53
Benchmark_CORS_NewHandlerPreflightSingleOrigin - ns/op
1162
ns/op757.5
ns/op1.53
Benchmark_CORS_NewHandlerPreflightSingleOrigin - B/op
104
B/op0
B/op+∞
Benchmark_CORS_NewHandlerPreflightSingleOrigin - allocs/op
5
allocs/op0
allocs/op+∞
Benchmark_CORS_NewHandlerPreflightWildcard
1089
ns/op 104 B/op 5 allocs/op691
ns/op 0 B/op 0 allocs/op1.58
Benchmark_CORS_NewHandlerPreflightWildcard - ns/op
1089
ns/op691
ns/op1.58
Benchmark_CORS_NewHandlerPreflightWildcard - B/op
104
B/op0
B/op+∞
Benchmark_CORS_NewHandlerPreflightWildcard - allocs/op
5
allocs/op0
allocs/op+∞
Benchmark_Middleware_CSRF_Check - allocs/op
11
allocs/op7
allocs/op1.57
Benchmark_Middleware_CSRF_GenerateToken - B/op
510
B/op326
B/op1.56
Benchmark_Middleware_CSRF_GenerateToken - allocs/op
10
allocs/op6
allocs/op1.67
This comment was automatically generated by workflow using github-action-benchmark.