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

importinto: add metrics and dashboard #46749

Merged
merged 14 commits into from
Sep 11, 2023
Merged

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Sep 7, 2023

What problem does this PR solve?

Issue Number: ref #46704

Problem Summary:

What is changed and how it works?

add metrics and dashboard for import into tasks to help monitor and diagnose.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

some board last longer than others as it's calculating rate in a time window

img_v2_3bb48b98-d023-442f-b4af-31741eafa8fg
img_v2_1030fc10-0fc8-4a50-9e1b-7ebcd8c0f3cg

  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed do-not-merge/needs-linked-issue labels Sep 7, 2023
@tiprow
Copy link

tiprow bot commented Sep 7, 2023

Hi @D3Hunter. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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.

@D3Hunter
Copy link
Contributor Author

D3Hunter commented Sep 7, 2023

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Sep 7, 2023
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #46749 (0229d3b) into master (17baf99) will decrease coverage by 0.4918%.
Report is 2 commits behind head on master.
The diff coverage is 80.2419%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46749        +/-   ##
================================================
- Coverage   73.3707%   72.8789%   -0.4918%     
================================================
  Files          1326       1348        +22     
  Lines        396691     403904      +7213     
================================================
+ Hits         291055     294361      +3306     
- Misses        87092      90948      +3856     
- Partials      18544      18595        +51     
Flag Coverage Δ
integration 27.7513% <0.0000%> (?)
unit 73.5021% <80.2419%> (+0.1314%) ⬆️

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 85.0019% <ø> (ø)
br 48.4952% <99.2805%> (-4.2668%) ⬇️

@D3Hunter
Copy link
Contributor Author

D3Hunter commented Sep 8, 2023

/retest

Copy link
Member

@okJiang okJiang 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

br/pkg/lightning/metric/metric.go Outdated Show resolved Hide resolved
br/pkg/lightning/metric/metric.go Show resolved Hide resolved
br/pkg/lightning/metric/metric.go Outdated Show resolved Hide resolved
var ctxKey ctxKeyType
var (
allMetricKey ctxKeyType = "all-metrics"
commonMetricKey ctxKeyType = "common-metrics"
Copy link
Member

Choose a reason for hiding this comment

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

How about shared-metrics?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's very similar to common. let's wait other reviewer's opinions

br/pkg/lightning/metric/metric.go Show resolved Hide resolved
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Sep 8, 2023

/retest

Copy link
Member

@okJiang okJiang 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

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 11, 2023
@@ -220,6 +221,10 @@ func (dsp *importDispatcherExt) OnNextStage(ctx context.Context, handle dispatch
var nextStep int64
switch gTask.Step {
case proto.StepInit:
if metrics, ok := metric.GetCommonMetric(ctx); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not add this counter when generating the taskMeta.Plan?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean on creating task? we only want this metric after the task start running

@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: okJiang, ywqzzy

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 11, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 11, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-11 04:20:59.757201503 +0000 UTC m=+243041.681757892: ☑️ agreed by okJiang.
  • 2023-09-11 10:57:40.146732085 +0000 UTC m=+266842.071288479: ☑️ agreed by ywqzzy.

@D3Hunter
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 322d8e5 into pingcap:master Sep 11, 2023
13 of 16 checks passed
@D3Hunter D3Hunter deleted the import-metrics branch September 11, 2023 16:55
@okJiang okJiang mentioned this pull request Sep 22, 2023
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants