-
Notifications
You must be signed in to change notification settings - Fork 225
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 executor runtime stats performance #1532
Conversation
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
internal/locate/region_request.go
Outdated
} | ||
|
||
// GetRPCCount returns the total rpc types count. | ||
func (r *RegionRequestRuntimeStats) GetRPCCount() int { |
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.
How about to use GetRPCStatsCount
(or sth else)? This name make me think it returns the total number of RPCs of all cmd types.
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.
great, done.
internal/locate/region_request.go
Outdated
// this is to avoid allocating map memory. | ||
FirstRPCStats RPCRuntimeStats | ||
// OtherRPCStatsMap uses to record another types of RPC requests. | ||
OtherRPCStatsMap map[tikvrpc.CmdType]*RPCRuntimeStats |
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.
Just a suggestion, since one RegionRequestSender typically only send one (or a few) kind(s) of RPC, I guess we can just use a slice here to make the code clean and simple.
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.
great, done.
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, zyguan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR tiny optimize
RegionRequestRuntimeStats
andSnapshotRuntimeStats
by remove useless field and avoid create map.