Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review Limiter interface #35

Merged
merged 3 commits into from
Oct 31, 2023
Merged

Review Limiter interface #35

merged 3 commits into from
Oct 31, 2023

Conversation

k1LoW
Copy link
Member

@k1LoW k1LoW commented Oct 31, 2023

  • Rename LimitError to Context.
  • Accept Context straight away.
  • Fix Context to retain the value of limitHandler at the time of
  • Export Context fields for implementing Limiter

- Accept LimitError straight away.
- Fix LimitError to retain the value of limitHandler at the time of
- Export LimitError fields for creating Limiter
@k1LoW k1LoW added enhancement New feature or request minor breaking-change labels Oct 31, 2023
@k1LoW k1LoW self-assigned this Oct 31, 2023
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Code Metrics Report

main (c10a935) #35 (c19212d) +/-
Coverage 80.8% 79.5% -1.3%
Code to Test Ratio 1:0.9 1:0.9 -0.0
Test Execution Time 16s 18s +2s
Details
  |                     | main (c10a935) | #35 (c19212d) |  +/-  |
  |---------------------|----------------|---------------|-------|
- | Coverage            |          80.8% |         79.5% | -1.3% |
  |   Files             |              2 |             2 |     0 |
  |   Lines             |             78 |            73 |    -5 |
- |   Covered           |             63 |            58 |    -5 |
- | Code to Test Ratio  |          1:0.9 |         1:0.9 |  -0.0 |
  |   Code              |            219 |           214 |    -5 |
- |   Test              |            204 |           196 |    -8 |
- | Test Execution Time |            16s |           18s |   +2s |

Code coverage of files in pull request scope (80.8% → 79.5%)

Files Coverage +/-
context.go 50.0% +50.0%
error.go 0.0% -85.7%
rl.go 80.3% 0.0%

Reported by octocov

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

BenchmarkRL-2

main (-) #35 (c19212d) +/-
Number of iterations 10000 10000 0
Nanoseconds per iteration 194273 ns/op 192010 ns/op -2263 ns/op
Bytes allocated per iteration 18374 B/op 18409 B/op 35 B/op
Allocs per iteration 156 allocs/op 155 allocs/op -1 allocs/op
Metadata
main (-) #35 (c19212d)
goos linux linux
goarch amd64 amd64
pkg github.com/k1LoW/rl github.com/k1LoW/rl
cpu Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz

Cachegrind (./testdata/testbin/testbin 10000)

main (-) #35 (c19212d) +/-
Ir 1170284541 45287258307 44116973766
I1mr 8693100 8656605 -36495
ILmr 5957 5963 6
Dr 332457311 14293582451 13961125140
D1mr 763554 729998 -33556
DLmr 14407 14026 -381
Dw 145631293 5450814868 5305183575
D1mw 619797 628025 8228
DLmw 72378 72416 38
Metadata
main (-) #35 (c19212d)
I1 cache 32768 B, 64 B, 8-way associative 32768 B, 64 B, 8-way associative
D1 cache 32768 B, 64 B, 8-way associative 32768 B, 64 B, 8-way associative
LL cache 8388608 B, 64 B, 16-way associative 8388608 B, 64 B, 16-way associative
cmd ./testdata/testbin/testbin 10000 ./testdata/testbin/testbin 10000

Reported by octocov

@k1LoW k1LoW merged commit 4b66a42 into main Oct 31, 2023
4 checks passed
@k1LoW k1LoW deleted the fix-limiter-interface branch October 31, 2023 02:19
@github-actions github-actions bot mentioned this pull request Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant