-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
disttask: add metrics collection for dispatcher #47018
Conversation
Hi @JK1Zhang. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Hi @JK1Zhang. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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. |
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 more enhancement
Co-authored-by: okJiang <jiangxianjie@pingcap.com>
Co-authored-by: okJiang <jiangxianjie@pingcap.com>
if dm.checkConcurrencyOverflow(cnt) { | ||
break | ||
} | ||
|
||
// TODO: Consider getting these tasks, in addition to the task being worked on.. | ||
tasks, err := dm.taskMgr.GetGlobalTasksInStates(proto.TaskStatePending, proto.TaskStateRunning, proto.TaskStateReverting, proto.TaskStateCancelling) |
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 initializing the metrics with these tasks when the DispatcherManager starts?
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.
It is precise.
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.
For DistDDLTaskStarttimeGauge, I think it's not necessary to initialize here because it doesn't change.
For DistDDLTaskGauge, should I go through all the tasks in the tidb_global_task table?
/cc @ywqzzy |
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
Co-authored-by: EasonBall <592838129@qq.com>
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
metrics/disttask.go
Outdated
|
||
// UpdateMetricsForDisptchTask update metrics when a task is added | ||
func UpdateMetricsForDisptchTask(task *proto.Task) { | ||
DistTaskGauge.WithLabelValues(task.Type, WaitingStatus).Set(float64(300)) |
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.
what does 300 means?
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.
useless , deleted
Co-authored-by: EasonBall <592838129@qq.com>
Co-authored-by: D3Hunter <jujj603@gmail.com>
Co-authored-by: D3Hunter <jujj603@gmail.com>
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Benjamin2037, okJiang 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 |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: close #47017
Problem Summary:
What is changed and how it works?
Check List
Tests
Manual test
1. start TiDB in playground
2. test with mysql
mysql --comments --host 127.0.0.1 --port 4000 -u root
test cmd
3. grafana result
calculate in grafana (dispatching is happening too fast to see the data points )
panel "task dispatching time" metrics: "time() - tidb_disttask_dispatcher_start_time{status="dispatching"}/1000000"
calculate in dispatcher_manager.go
panel "task dispatching duration" metrics: tidb_disttask_dispatcher_duration{status="dispatching"}
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.