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. DetailsInstructions 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. DetailsInstructions 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. |
Co-authored-by: okJiang <jiangxianjie@pingcap.com>
Co-authored-by: okJiang <jiangxianjie@pingcap.com>
| } | ||
|
|
||
| // 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.
How about initializing the metrics with these tasks when the DispatcherManager starts?
There was a problem hiding this comment.
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 |
Co-authored-by: EasonBall <592838129@qq.com>
|
|
||
| // UpdateMetricsForDisptchTask update metrics when a task is added | ||
| func UpdateMetricsForDisptchTask(task *proto.Task) { | ||
| DistTaskGauge.WithLabelValues(task.Type, WaitingStatus).Set(float64(300)) |
Co-authored-by: EasonBall <592838129@qq.com>
Co-authored-by: D3Hunter <jujj603@gmail.com>
Co-authored-by: D3Hunter <jujj603@gmail.com>
|
[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 DetailsNeeds 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 roottest 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.