-
Notifications
You must be signed in to change notification settings - Fork 727
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
statistics: refactor #1750
statistics: refactor #1750
Conversation
"github.com/montanaflynn/stats" | ||
) | ||
|
||
func storeTag(id uint64) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function also can be used somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So where should I put it?
package statistics | ||
|
||
// StoreHotRegionInfos : used to get human readable description for hot regions. | ||
type StoreHotRegionInfos struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to merge this file into hot_regions_stat.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two struct are too simple, and not use by other types or functions in this package. So I'm thinking about moving them to where they are used.
Is there any suggestions?
Codecov Report
@@ Coverage Diff @@
## master #1750 +/- ##
==========================================
+ Coverage 77.32% 77.51% +0.18%
==========================================
Files 163 166 +3
Lines 16433 16395 -38
==========================================
+ Hits 12707 12708 +1
+ Misses 2674 2657 -17
+ Partials 1052 1030 -22
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please resolve the conflict.
/run-all-tests |
(cherry picked from commit 2550168) Signed-off-by: lhy1024 <admin@liudos.us>
What problem does this PR solve?
The statistics package is too hard to understand.
What is changed and how it works?
Refactor it. There are mainly these kinds of changes:
if
branches to make logic more clearThere are still some problems, but considering that this PR is already changed a lot of things, I'd like to improve them in future PRs.
Check List
Tests