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

doubt about default value of avgUsedTokens #459

Closed
mjaow opened this issue Jan 26, 2019 · 0 comments · Fixed by #460
Closed

doubt about default value of avgUsedTokens #459

mjaow opened this issue Jan 26, 2019 · 0 comments · Fixed by #460
Labels
kind/question Category issues related to questions or problems

Comments

@mjaow
Copy link
Contributor

mjaow commented Jan 26, 2019

Issue Description

the default traffic limiter has code

    private int avgUsedTokens(Node node) {
        if (node == null) {
            return -1;
        }
        return grade == RuleConstant.FLOW_GRADE_THREAD ? node.curThreadNum() : (int)node.passQps();
    }

I'm not sure why return -1 as default value.Seems Zero is more meaningful

Type: bug report or feature request

bug report

Describe what happened (or what feature you want)

it return -1 as default value

Describe what you expected to happen

expected return 0 as default value

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

@sentinel-bot sentinel-bot added the kind/question Category issues related to questions or problems label Jan 26, 2019
@mjaow mjaow changed the title question about default avgUsedTokens default value of avgUsedTokens Jan 26, 2019
@mjaow mjaow changed the title default value of avgUsedTokens doubt about default value of avgUsedTokens Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Category issues related to questions or problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants