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

Optimize for statistic data structures #47

Merged
merged 3 commits into from
Aug 8, 2018
Merged

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Aug 8, 2018

Describe what this PR does / why we need it

Bug fix and optimization for statistic data structures, and update test cases.

Describe how you did it

  • Fix a bug: old position is not cleaned when inserting into a new (empty) position
  • Reuse buckets for optimization
  • The strategy is now changed: deprecated buckets will not be reset until newer time triggered. LeapArray is responsible for filtering the deprecated buckets (e.g. in list or values)
  • Update test cases

Describe how to verify it

See updated test cases.

sczyh30 added 2 commits August 3, 2018 15:42
- Fix a bug: old position is not cleaned when inserting into a new (empty) position
- Reuse buckets for optimization
- The strategy is now changed: deprecated buckets will not be reset until newer time triggered. LeapArray is responsible for filtering the deprecated buckets (e.g. in `list` or `values`)
- Update test cases

Signed-off-by: Eric Zhao <[email protected]>
Signed-off-by: Eric Zhao <[email protected]>
@sczyh30 sczyh30 added the kind/enhancement Category issues or prs related to enhancement. label Aug 8, 2018
@sczyh30 sczyh30 requested a review from CarpenterLee August 8, 2018 08:21
@sczyh30 sczyh30 added the to-review To review label Aug 8, 2018
Signed-off-by: Eric Zhao <[email protected]>
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

@codecov-io
Copy link

Codecov Report

Merging #47 into master will increase coverage by 0.25%.
The diff coverage is 81.25%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #47      +/-   ##
============================================
+ Coverage     45.73%   45.98%   +0.25%     
- Complexity      550      557       +7     
============================================
  Files           113      113              
  Lines          3800     3801       +1     
  Branches        533      529       -4     
============================================
+ Hits           1738     1748      +10     
+ Misses         1849     1841       -8     
+ Partials        213      212       -1
Impacted Files Coverage Δ Complexity Δ
...baba/csp/sentinel/slots/statistic/base/Window.java 97.29% <100%> (+20.82%) 14 <0> (+2) ⬆️
...ntinel/slots/statistic/metric/WindowLeapArray.java 80% <100%> (+9.03%) 6 <1> (-1) ⬇️
.../csp/sentinel/slots/statistic/base/WindowWrap.java 76.92% <66.66%> (-3.08%) 5 <1> (+1)
...a/csp/sentinel/slots/statistic/base/LeapArray.java 76.92% <66.66%> (-2.03%) 15 <2> (+4)
...ibaba/csp/sentinel/eagleeye/EagleEyeLogDaemon.java 24.24% <0%> (-6.07%) 5% <0%> (-1%)
...a/com/alibaba/csp/sentinel/node/StatisticNode.java 64.91% <0%> (+3.5%) 16% <0%> (+1%) ⬆️
...a/csp/sentinel/slots/statistic/base/LongAdder.java 19.14% <0%> (+4.25%) 5% <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 4051458...ccacf9b. Read the comment docs.

@sczyh30 sczyh30 removed the to-review To review label Aug 8, 2018
@sczyh30 sczyh30 merged commit a65d160 into master Aug 8, 2018
@sczyh30 sczyh30 deleted the enhancement/leap-array branch August 8, 2018 11:36
@sczyh30 sczyh30 added this to the 0.1.1 milestone Aug 8, 2018
sczyh30 added a commit that referenced this pull request Aug 8, 2018
* Optimize for leap array

- Fix a bug: old position is not cleaned when inserting into a new (empty) position
- Reuse buckets for optimization
- The strategy is now changed: deprecated buckets will not be reset until newer time triggered. LeapArray is responsible for filtering the deprecated buckets (e.g. in `list` or `values`)
- Update test cases

Signed-off-by: Eric Zhao <[email protected]>
Arlmls pushed a commit to Arlmls/Sentinel that referenced this pull request Jan 8, 2019
* Optimize for leap array

- Fix a bug: old position is not cleaned when inserting into a new (empty) position
- Reuse buckets for optimization
- The strategy is now changed: deprecated buckets will not be reset until newer time triggered. LeapArray is responsible for filtering the deprecated buckets (e.g. in `list` or `values`)
- Update test cases

Signed-off-by: Eric Zhao <[email protected]>
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