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

resource_manager/client: introduce RU and Request metrics #6170

Merged
merged 9 commits into from Mar 20, 2023

Conversation

CabinfeverB
Copy link
Member

@CabinfeverB CabinfeverB commented Mar 15, 2023

What problem does this PR solve?

Issue Number: close #6136

What is changed and how does it work?

image
image
image

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Code changes

Side effects

Related changes

Release note

None.

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 15, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • nolouch

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

requestUnitConfigPath = "resource_group/ru_config"
maxRetry = 3
maxNotificationChanLen = 200
requestUnitConfigPath = "resource_group/ru_config"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need consist with #6063

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be resolved automatically after merging #6063

resourceGroupTokenRequestCounter.WithLabelValues(name).Inc()
// RU info.
if consumption.RRU != 0 {
rruMetrics.Observe(consumption.RRU)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it's duplicated with the server side?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JmPotato @BornChanger Do u think it is necessary to count RU consumption of tidb instances?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may do not need in current.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't really think about the need to view RU consumption at the instance level, so not keeping a record is okay for me.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 16, 2023
@ti-chi-bot
Copy link
Member

@CabinfeverB: PR needs rebase.

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 kubernetes/test-infra repository.

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Patch coverage: 77.00% and project coverage change: +0.03 🎉

Comparison is base (6eb4410) 74.54% compared to head (964a37c) 74.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6170      +/-   ##
==========================================
+ Coverage   74.54%   74.57%   +0.03%     
==========================================
  Files         393      394       +1     
  Lines       38527    38644     +117     
==========================================
+ Hits        28719    28819     +100     
- Misses       7268     7285      +17     
  Partials     2540     2540              
Flag Coverage Δ
unittests 74.57% <77.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
client/errs/errno.go 100.00% <ø> (ø)
pkg/mcs/meta_storage/server/grpc_service.go 59.61% <0.00%> (ø)
pkg/mcs/resource_manager/server/grpc_service.go 67.77% <0.00%> (ø)
pkg/storage/endpoint/key_path.go 93.33% <ø> (ø)
server/api/server.go 100.00% <ø> (ø)
client/tso_stream.go 73.49% <31.25%> (-5.38%) ⬇️
client/keyspace_client.go 63.63% <33.33%> (ø)
client/meta_storage_client.go 68.47% <50.00%> (ø)
client/resource_manager_client.go 70.29% <50.00%> (ø)
client/resource_group/controller/limiter.go 69.93% <60.00%> (ø)
... and 18 more

... and 16 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 17, 2023
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

const (
namespace = "resource_manager_client"
requestSubsystem = "request"
ruSubsystem = "resource_unit"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this one.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 20, 2023
@nolouch
Copy link
Contributor

nolouch commented Mar 20, 2023

ptal @JmPotato

Help: "",
}, []string{resourceGroupNameLabel})

successfulTokenRequestDuration = prometheus.NewHistogram(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add some comments on why "success" is a "Histogram" and "failure" is a "counter".

Help: "",
}, []string{resourceGroupNameLabel})

failedRequestCounter = prometheus.NewCounterVec(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better use label about failed and success.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think failed requests need to be recorded, so failedRequestCounter is Counter.

@@ -192,6 +197,7 @@ func (c *ResourceGroupsController) Start(ctx context.Context) {
for {
select {
case <-c.loopCtx.Done():
c.resetMetrics()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to reset resourceGroupStatusGauge for each resource group when it's deleted from the client?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I do it in cleanUpResourceGroup

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@HuSharp HuSharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM!

Subsystem: requestSubsystem,
Name: "success",
Buckets: prometheus.ExponentialBuckets(0.001, 4, 8), // 0.001 ~ 40.96
Help: "Bucketed histogram of wait duration of successfult request.",
Copy link
Member

@HuSharp HuSharp Mar 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

successful not successfult

@ti-chi-bot
Copy link
Member

@HuSharp: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

rest LGTM!

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.

Copy link
Member

@JmPotato JmPotato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest LGTM.

client/resource_group/controller/controller.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 20, 2023
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@nolouch
Copy link
Contributor

nolouch commented Mar 20, 2023

/merge

@ti-chi-bot
Copy link
Member

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: a62c7cd

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 20, 2023
@ti-chi-bot
Copy link
Member

@CabinfeverB: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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.

@ti-chi-bot ti-chi-bot merged commit 220dbed into tikv:master Mar 20, 2023
18 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.0: #6197.

ti-chi-bot added a commit to ti-chi-bot/pd that referenced this pull request Mar 21, 2023
close tikv#6136

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
CabinfeverB added a commit to CabinfeverB/pd that referenced this pull request Mar 22, 2023
close tikv#6136

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
ti-chi-bot added a commit that referenced this pull request Mar 22, 2023
)

close #6136, ref #6170

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: Yongbo Jiang <cabinfeveroier@gmail.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Co-authored-by: lhy1024 <admin@liudos.us>
CabinfeverB added a commit to ti-chi-bot/pd that referenced this pull request Mar 22, 2023
…tikv#6197)

close tikv#6136, ref tikv#6170

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: Yongbo Jiang <cabinfeveroier@gmail.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Co-authored-by: lhy1024 <admin@liudos.us>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
CabinfeverB added a commit to ti-chi-bot/pd that referenced this pull request Mar 22, 2023
…tikv#6197)

close tikv#6136, ref tikv#6170

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: Yongbo Jiang <cabinfeveroier@gmail.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Co-authored-by: lhy1024 <admin@liudos.us>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-7.0 release-note-none status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add metrics in resource group controller.
5 participants