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

rate limit filter #169

Merged
merged 45 commits into from
Jun 24, 2021
Merged

rate limit filter #169

merged 45 commits into from
Jun 24, 2021

Conversation

mark4z
Copy link
Member

@mark4z mark4z commented May 17, 2021

What this PR does:

Which issue(s) this PR fixes:

Fixes #10

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@codecov-commenter
Copy link

codecov-commenter commented May 17, 2021

Codecov Report

Merging #169 (5c7985d) into develop (4bae729) will increase coverage by 0.15%.
The diff coverage is 44.44%.

❗ Current head 5c7985d differs from pull request most recent head 33e3246. Consider uploading reports for the commit 33e3246 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #169      +/-   ##
===========================================
+ Coverage    43.14%   43.29%   +0.15%     
===========================================
  Files           33       37       +4     
  Lines         1757     1834      +77     
===========================================
+ Hits           758      794      +36     
- Misses         890      928      +38     
- Partials       109      112       +3     
Impacted Files Coverage Δ
pkg/filter/ratelimit/rate_limit.go 0.00% <0.00%> (ø)
pkg/pixiu/listener.go 19.58% <0.00%> (-0.21%) ⬇️
pkg/pixiu/pixiu_start.go 0.00% <0.00%> (ø)
pkg/registry/consul.go 78.94% <ø> (ø)
pkg/registry/util.go 0.00% <ø> (ø)
pkg/service/api/discovery_service.go 64.91% <0.00%> (-0.09%) ⬇️
pkg/filter/ratelimit/logger_warpper.go 11.11% <11.11%> (ø)
pkg/filter/plugins/plugins.go 31.25% <26.08%> (-2.09%) ⬇️
pkg/filter/ratelimit/init.go 64.70% <64.70%> (ø)
pkg/filter/ratelimit/mock.go 100.00% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4bae729...33e3246. Read the comment docs.

@AlexStocks
Copy link
Contributor

pls fix the go.mod confliction.

@@ -165,7 +189,7 @@ func getAPIFilterFuncsWithPluginsGroup(plu *config.PluginsInUse) []context.Filte

// found with group name
for _, groupName := range plu.GroupNames {
pwfMap, found := groupWithPluginsMap[groupName]
pwfMap, found := groupCache[groupName]
if found {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if !found { continue } for _, pwf := range pwfMap { tmpMap[pwf.Name] = pwf.fn }

@@ -0,0 +1,62 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this code make sense?

type Exact struct {
apiNames map[string]string

mu sync.RWMutex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI,I think pointer is better

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mu *sync.RWMutex, this way?

@xiaoliu10 xiaoliu10 merged commit fbaf7ed into apache:develop Jun 24, 2021
@mark4z mark4z deleted the ratelimit branch June 24, 2021 12:29
@xiaoliu10 xiaoliu10 added this to the v0.3.0 milestone Jul 2, 2021
mark4z added a commit that referenced this pull request Nov 7, 2021
* update dubbo-go to v1.5.6 & fmt sth.

* fix fmt

* Update go.mod

* update dubbo-go to v1.5.6 & fmt sth.

* update dubbo-go to v1.5.6 & fmt sth.

* fix fmt

* rateLimit filter

* add licence header

* fix imports

* add license header

* add license header

* fix ci

* fix matcher var inline

* fix ci

* fix sync.RWMutex

* errors.warp

* test table

* remove unreachable statement

* Pattern pattern,omitempty

* update develop

* update the docs for ratelimit

* update develop

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

Co-authored-by: Zhenxu Ke <[email protected]>
Former-commit-id: fbaf7ed
tydhot pushed a commit to tydhot/dubbo-go-pixiu that referenced this pull request Nov 10, 2021
* update dubbo-go to v1.5.6 & fmt sth.

* fix fmt

* Update go.mod

* update dubbo-go to v1.5.6 & fmt sth.

* update dubbo-go to v1.5.6 & fmt sth.

* fix fmt

* rateLimit filter

* add licence header

* fix imports

* add license header

* add license header

* fix ci

* fix matcher var inline

* fix ci

* fix sync.RWMutex

* errors.warp

* test table

* remove unreachable statement

* Pattern pattern,omitempty

* update develop

* update the docs for ratelimit

* update develop

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

Co-authored-by: Zhenxu Ke <[email protected]>
Former-commit-id: 4cb8c13 [formerly fbaf7ed]
Former-commit-id: 83790e7
bobtthp pushed a commit to bobtthp/dubbo-go-pixiu that referenced this pull request Dec 12, 2022
* update dubbo-go to v1.5.6 & fmt sth.

* fix fmt

* Update go.mod

* update dubbo-go to v1.5.6 & fmt sth.

* update dubbo-go to v1.5.6 & fmt sth.

* fix fmt

* rateLimit filter

* add licence header

* fix imports

* add license header

* add license header

* fix ci

* fix matcher var inline

* fix ci

* fix sync.RWMutex

* errors.warp

* test table

* remove unreachable statement

* Pattern pattern,omitempty

* update develop

* update the docs for ratelimit

* update develop

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

* ratelimit filter

Co-authored-by: Zhenxu Ke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add rate limit filter
7 participants