-
Notifications
You must be signed in to change notification settings - Fork 726
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
*: add API concurrency metrics #7541
*: add API concurrency metrics #7541
Conversation
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]> address comment Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[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. |
metrics/grafana/pd.json
Outdated
"dashLength": 10, | ||
"dashes": false, | ||
"datasource": "${DS_TEST-CLUSTER}", | ||
"description": "The concurrency number ofeach kind of gRPC commands", |
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.
"description": "The concurrency number ofeach kind of gRPC commands", | |
"description": "The concurrency number of each kind of gRPC commands", |
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
server/grpc_service.go
Outdated
@@ -678,7 +744,7 @@ func (s *GrpcServer) GetStore(ctx context.Context, request *pdpb.GetStoreRequest | |||
} else if rsp != nil { | |||
return rsp.(*pdpb.GetStoreResponse), err | |||
} | |||
|
|||
time.Sleep(120 * time.Millisecond) |
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 sleep?
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.
Sorry, I forgot to delete this when addressing the comment. I can't count concurrency without this during manual testing.
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 remove it.
pkg/ratelimit/controller.go
Outdated
label := key.(string) | ||
// Due to not in hot path, no need to save sub Gauge. | ||
if con := limiter.getConcurrencyLimiter(); con != nil { | ||
l.concurrencyGauge.WithLabelValues(l.apiType, label).Set(float64(con.getCurrent())) |
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.
Maybe we can find another way to show the statistics, the current implementation only captures the instant value every 15s.
Signed-off-by: Cabinfever_B <[email protected]>
pkg/ratelimit/concurrency_limiter.go
Outdated
@@ -68,3 +74,13 @@ func (l *concurrencyLimiter) getCurrent() uint64 { | |||
|
|||
return l.current | |||
} | |||
|
|||
func (l *concurrencyLimiter) getMaxConcurrency() uint64 { | |||
l.mu.RLock() |
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.
Should be Lock
?
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
/retest |
/test |
@HuSharp: The
The following commands are available to trigger optional jobs:
Use
In response to this:
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. |
/test build |
Signed-off-by: Cabinfever_B <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7541 +/- ##
==========================================
- Coverage 74.87% 74.80% -0.08%
==========================================
Files 459 459
Lines 50668 50975 +307
==========================================
+ Hits 37939 38130 +191
- Misses 9385 9482 +97
- Partials 3344 3363 +19
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
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.
rest lgtm
server/grpc_service.go
Outdated
@@ -678,7 +744,7 @@ func (s *GrpcServer) GetStore(ctx context.Context, request *pdpb.GetStoreRequest | |||
} else if rsp != nil { | |||
return rsp.(*pdpb.GetStoreResponse), err | |||
} | |||
|
|||
time.Sleep(120 * time.Millisecond) |
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 remove it.
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
/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: c34d2b1
|
ref tikv#7167 Signed-off-by: Cabinfever_B <[email protected]> Signed-off-by: pingandb <[email protected]>
What problem does this PR solve?
Issue Number: ref #7167
should be merged after #7239
What is changed and how does it work?
Enable concurrency monitoring for all APIs
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note