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

api: add region stats. #840

Merged
merged 3 commits into from Nov 9, 2017

Conversation

Projects
None yet
4 participants
@disksing
Member

disksing commented Nov 8, 2017

Fix #832
Fix #817

disksing added some commits Nov 7, 2017

@disksing disksing requested review from siddontang, nolouch and Connor1996 Nov 8, 2017

@nolouch

This comment has been minimized.

Show comment
Hide comment
@nolouch

nolouch Nov 9, 2017

Member

LGTM

Member

nolouch commented Nov 9, 2017

LGTM

func (r *RegionsInfo) GetRegionStats(startKey, endKey []byte) *RegionStats {
stats := newRegionStats()
r.tree.scanRange(startKey, func(meta *metapb.Region) bool {
if len(endKey) > 0 && (len(meta.EndKey) == 0 || bytes.Compare(meta.EndKey, endKey) >= 0) {

This comment has been minimized.

@Connor1996

Connor1996 Nov 9, 2017

Member

how about to move "len(endKey) > 0" out of scanRange

@Connor1996

Connor1996 Nov 9, 2017

Member

how about to move "len(endKey) > 0" out of scanRange

This comment has been minimized.

@disksing

disksing Nov 9, 2017

Member

Here endKey=="" means never break and scan to the last region, seems impossible to move out.

@disksing

disksing Nov 9, 2017

Member

Here endKey=="" means never break and scan to the last region, seems impossible to move out.

@nolouch

nolouch approved these changes Nov 9, 2017

@siddontang

Rest LGTM

@disksing disksing merged commit fca123a into pingcap:master Nov 9, 2017

4 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-pd/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@disksing disksing deleted the disksing:region-stat branch Nov 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment