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

Add appType property field in SentinelConfig #696

Merged
merged 2 commits into from
Apr 23, 2019
Merged

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Apr 23, 2019

Describe what this PR does / why we need it

Add an appType property field in SentinelConfig which can be retrieved from csp.sentinel.app.type argument. It's useful to identify the service type (e.g. API gateway).

Does this pull request fix one issue?

NONE

Describe how you did it

Add an appType property field in SentinelConfig. It will be parsed during initialization of SentinelConfig. If the provided value is invalid or empty, it will be set to 0 (common) by default.

Describe how to verify it

Run the test cases.

Special notes for reviews

None.

- The `appType` can be retrieved from `csp.sentinel.app.type` field. It's useful to identify the service type (e.g. API gateway).

Signed-off-by: Eric Zhao <[email protected]>
@sczyh30 sczyh30 added the kind/enhancement Category issues or prs related to enhancement. label Apr 23, 2019
@sczyh30 sczyh30 added this to the 1.6.0 milestone Apr 23, 2019
@codecov-io
Copy link

codecov-io commented Apr 23, 2019

Codecov Report

Merging #696 into master will increase coverage by 0.01%.
The diff coverage is 52.17%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #696      +/-   ##
============================================
+ Coverage     41.17%   41.19%   +0.01%     
- Complexity     1315     1318       +3     
============================================
  Files           288      288              
  Lines          8478     8496      +18     
  Branches       1147     1149       +2     
============================================
+ Hits           3491     3500       +9     
- Misses         4551     4560       +9     
  Partials        436      436
Impacted Files Coverage Δ Complexity Δ
.../main/java/com/alibaba/csp/sentinel/Constants.java 100% <ø> (+16.66%) 1 <0> (ø) ⬇️
...om/alibaba/csp/sentinel/config/SentinelConfig.java 51.61% <52.17%> (-3.8%) 14 <2> (+1)
.../slots/block/flow/controller/WarmUpController.java 82.69% <0%> (+3.84%) 11% <0%> (+1%) ⬆️

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 845b258...1e22eab. Read the comment docs.

@sczyh30 sczyh30 added the to-review To review label Apr 23, 2019
Copy link
Contributor

@CarpenterLee CarpenterLee left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants