Skip to content

Conversation

Alipebt
Copy link
Contributor

@Alipebt Alipebt commented Mar 22, 2023

Describe what this PR does / why we need it

the existing reset() function is not being used and a new MetricBucket is recreated in the ResetBucketTo() function. Therefore, we want to optimize our code to call reset() to avoid this unnecessary operation

Does this pull request fix one issue?

Fixes #403

Describe how you did it

add reset() to ResetBucketTo()
The addRT() mentioned in the issue is not thread-safe, I think we can lose some precision to ensure the efficient execution of the program, so I did not modify the function

@CLAassistant
Copy link

CLAassistant commented Mar 22, 2023

CLA assistant check
All committers have signed the CLA.

@sczyh30 sczyh30 requested review from binbin0325 and sczyh30 March 24, 2023 02:27
@sczyh30
Copy link
Member

sczyh30 commented Mar 24, 2023

Could you please reformat your code with gofmt?

@sczyh30 sczyh30 added the kind/enhancement Category issues or PRs related to enhancement label Mar 24, 2023
@Alipebt Alipebt requested a review from binbin0325 April 2, 2023 12:44
@Alipebt
Copy link
Contributor Author

Alipebt commented Apr 3, 2023

@binbin0325 Is there something else wrong with my code now? Could you give me some suggestions for improvement or approve the review?

binbin0325
binbin0325 previously approved these changes Apr 3, 2023
Copy link
Collaborator

@binbin0325 binbin0325 left a comment

Choose a reason for hiding this comment

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

LGTM

@binbin0325 binbin0325 changed the title issue403 MetricBucket reset Apr 3, 2023
@binbin0325
Copy link
Collaborator

@Alipebt Please merge submission records into one

@Alipebt
Copy link
Contributor Author

Alipebt commented Apr 3, 2023

@binbin0325 I have completed the merge of commit

Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

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

LGTM

@sczyh30 sczyh30 merged commit 9113c84 into alibaba:master Apr 4, 2023
@sczyh30
Copy link
Member

sczyh30 commented Apr 4, 2023

Thanks for contributing!

binbin0325 pushed a commit to binbin0325/sentinel-golang that referenced this pull request Sep 18, 2024
binbin0325 pushed a commit to binbin0325/sentinel-golang that referenced this pull request Sep 18, 2024
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.

what does the reset() of MetricBucket do? seems no references

4 participants