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

test: use fgprof to show off-CPU profile in external package #50179

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Jan 8, 2024

What problem does this PR solve?

Issue Number: ref #48952

Problem Summary:

What changed and how does it work?

also upgrade the ks3 SDK

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

we can see network IO is shown in CPU flame graph
image

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

Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 8, 2024
Copy link

tiprow bot commented Jan 8, 2024

Hi @lance6716. 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.

Copy link

codecov bot commented Jan 8, 2024

Codecov Report

Merging #50179 (3bfa3b7) into master (f19d876) will decrease coverage by 12.0616%.
Report is 49 commits behind head on master.
The diff coverage is 17.8861%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #50179         +/-   ##
=================================================
- Coverage   79.3015%   67.2400%   -12.0616%     
=================================================
  Files          2447       2571        +124     
  Lines        673721     843187     +169466     
=================================================
+ Hits         534271     566959      +32688     
- Misses       118049     252392     +134343     
- Partials      21401      23836       +2435     
Flag Coverage Δ
integration 36.5653% <0.0000%> (?)
unit 79.2521% <17.8861%> (-0.0494%) ⬇️

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

Components Coverage Δ
dumpling 73.6130% <ø> (ø)
parser ∅ <ø> (∅)
br 71.7243% <17.8861%> (+3.2498%) ⬆️

@lance6716
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Jan 8, 2024

@lance6716: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 8, 2024
@wuhuizuo wuhuizuo marked this pull request as draft January 8, 2024 08:52
@lance6716 lance6716 changed the title [WIP]test: use fgprof to show off-CPU profile in external package test: use fgprof to show off-CPU profile in external package Jan 10, 2024
@lance6716 lance6716 marked this pull request as ready for review January 10, 2024 08:54
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 10, 2024
Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 10, 2024
@lance6716
Copy link
Contributor Author

/cc @Leavrth

@ti-chi-bot ti-chi-bot bot requested a review from Leavrth January 10, 2024 09:49
Comment on lines 873 to 900
heapProfDoneCh = make(chan struct{})
heapWg.Add(1)
go func() {
defer heapWg.Done()

var m runtime.MemStats
ticker := time.NewTicker(300 * time.Millisecond)
defer ticker.Stop()

for {
select {
case <-heapProfDoneCh:
return
case <-ticker.C:
runtime.ReadMemStats(&m)
if m.HeapInuse <= maxInUse {
continue
}
maxInUse = m.HeapInuse
file, err2 := os.Create(filenameHeap)
intest.AssertNoError(err2)
err = pprof.WriteHeapProfile(file)
intest.AssertNoError(err)
err = file.Close()
intest.AssertNoError(err)
}
}
}()
Copy link
Contributor

Choose a reason for hiding this comment

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

wrap a function?
Rest LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 11, 2024
Copy link

ti-chi-bot bot commented Jan 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-10 09:48:19.852789381 +0000 UTC m=+436689.437043062: ☑️ agreed by D3Hunter.
  • 2024-01-11 05:58:08.056481151 +0000 UTC m=+509277.640734838: ☑️ agreed by ywqzzy.

Copy link

tiprow bot commented Jan 11, 2024

@lance6716: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tiprow_fast_test 3bfa3b7 link true /test tiprow_fast_test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Copy link

ti-chi-bot bot commented Jan 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, Leavrth, 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 the approved label Jan 11, 2024
@ti-chi-bot ti-chi-bot bot merged commit 82744b3 into pingcap:master Jan 11, 2024
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants