-
Notifications
You must be signed in to change notification settings - Fork 728
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
mcs, client: support returning ru statistics in Get/ListResourceGroup response #7617
Conversation
Signed-off-by: glorv <[email protected]>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: glorv <[email protected]>
Signed-off-by: glorv <[email protected]>
Signed-off-by: glorv <[email protected]>
Signed-off-by: glorv <[email protected]>
Signed-off-by: glorv <[email protected]>
Signed-off-by: glorv <[email protected]>
Signed-off-by: glorv <[email protected]>
|
||
if rg.RUConsumption != nil { | ||
consumption := *rg.RUConsumption | ||
group.RUStats = &consumption |
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.
peresit consumption both in ResourceGroup.persistSettings
and SaveResourceGroupStates
? I think we can only persist once in GroupState.
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 is the side effect that both grpc and persistSettings uses IntoProtoResourceGroup
to serialize resource group. The RUStats in group setting is not used.
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 is RuStats
useless? can we remove it from proto.ResourceGroup?
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.
RuStats
is used in the grpc response
go.mod
Outdated
gotest.tools/gotestsum v1.7.0 | ||
) | ||
|
||
require ( | ||
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect |
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.
need format
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.
done
Signed-off-by: glorv <[email protected]>
} | ||
m.RUnlock() |
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.
why needs to change this?
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.
The original code is incorrect and unnecessary. 1) there is possible concurrency issue between RUnlock and Lock; 2) persistStates only requires read lock, thus no need to acquire Lock here.
Signed-off-by: glorv <[email protected]>
/retest |
Signed-off-by: glorv <[email protected]>
Signed-off-by: glorv <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7617 +/- ##
==========================================
+ Coverage 74.81% 74.88% +0.07%
==========================================
Files 459 459
Lines 50615 50647 +32
==========================================
+ Hits 37866 37927 +61
+ Misses 9405 9388 -17
+ Partials 3344 3332 -12
Flags with carried forward coverage won't be shown. Click here to find out more. |
/merge |
@CabinfeverB: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 260570c
|
What problem does this PR solve?
Issue Number: Close #7616
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note