Skip to content

resrc_mtr: reorganize code structure for flexibility#10998

Merged
ti-chi-bot merged 34 commits intotikv:masterfrom
mornyx:resource-metering-framework
Oct 15, 2021
Merged

resrc_mtr: reorganize code structure for flexibility#10998
ti-chi-bot merged 34 commits intotikv:masterfrom
mornyx:resource-metering-framework

Conversation

@mornyx
Copy link
Contributor

@mornyx mornyx commented Sep 28, 2021

What problem does this PR solve?

Reorganize resource-metering code structure to facilitate the addition of new modules.

What's Changed:

  • Promote most of the future reusable modules to the root path.
  • Split the Recorder into a SubRecorder trait for the collection of various resources.

Related changes

Check List

Tests

  • Unit test
  • Integration test

Release note

None

…n of new modules

Signed-off-by: mornyx <mornyx.z@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 28, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • andylokandy
  • zhongzc

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. labels Sep 28, 2021
@ti-srebot ti-srebot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Sep 28, 2021
@ti-chi-bot ti-chi-bot added contribution This PR is from a community contributor. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 28, 2021
@mornyx mornyx force-pushed the resource-metering-framework branch from 4c5ca18 to daa3499 Compare September 28, 2021 08:33
Signed-off-by: mornyx <mornyx.z@gmail.com>
Signed-off-by: mornyx <mornyx.z@gmail.com>
Signed-off-by: mornyx <mornyx.z@gmail.com>
Signed-off-by: mornyx <mornyx.z@gmail.com>
@mornyx
Copy link
Contributor Author

mornyx commented Sep 28, 2021

This PR was separated from tikv#10973 and only changes the code structure without adding the summary module. PTAL, Thanks!

/cc @zhongzc @crazycs520 @breeswish

@ti-chi-bot
Copy link
Member

@mornyx: GitHub didn't allow me to request PR reviews from the following users: crazycs520.

Note that only tikv members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

This PR is separated from tikv#10973 and only changes the code structure without adding the summary module. PTAL, Thanks!

/cc @zhongzc @crazycs520 @breeswish

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.

@mornyx mornyx marked this pull request as ready for review September 28, 2021 10:48
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 28, 2021
// TODO(mornyx): Review this case.
// (According to my personal observation, this should not be empty.)
//
// assert!(test_suite.fetch_reported_cpu_time().is_empty());
Copy link
Contributor

@zhongzc zhongzc Sep 30, 2021

Choose a reason for hiding this comment

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

The logic here comes from the fact that if the reporter's address was not set, the corresponding collector would be unregistered and the recorder would hang due to no collector. The recorder would restart on L35, but the result would be empty because the workload was cancelled in time on L31.

Nowadays collectors are not only the ones corresponding to the reporter but also the ones registered by the pd statistics collector, so the recorder keeps running. I think we can add a line between L35 and L36

test_suite.flush_agent();

to fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍
The reason for this problem is that I changed the Collector in Recorder to static binding.

Copy link
Contributor

Choose a reason for hiding this comment

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

fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried this method on the latest code, but the integration test still failed (pipeline here).

I think if we do clean up first and then wait, we will still receive the data, so I put test_suite.flush_receiver() between L36 and L37, and it passed the test. PLTA: test_dynamic_config.rs#L37.

Signed-off-by: mornyx <mornyx.z@gmail.com>
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 8, 2021
Signed-off-by: mornyx <mornyx.z@gmail.com>
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 8, 2021
Signed-off-by: mornyx <mornyx.z@gmail.com>
futures = "0.3"
pdqselect = "0.1"
fail = "0.4"
thread-id = "4.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

It is never used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to utils.rs#L31,we also provide a way to get the thread id on non-linux systems. It is only used to distinguish different threads, not for actual CPU sampling work.

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Member

@crazycs520: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

Details

In response to this:

LGTM

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.

Signed-off-by: mornyx <mornyx.z@gmail.com>
Signed-off-by: mornyx <mornyx.z@gmail.com>
Signed-off-by: mornyx <mornyx.z@gmail.com>
@zhongzc
Copy link
Contributor

zhongzc commented Oct 14, 2021

LGTM

Co-authored-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: mornyx <mornyx.z@gmail.com>
@mornyx mornyx force-pushed the resource-metering-framework branch from d1fce5f to 324df63 Compare October 15, 2021 04:37
Signed-off-by: mornyx <mornyx.z@gmail.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 15, 2021
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 15, 2021
@zhongzc
Copy link
Contributor

zhongzc commented Oct 15, 2021

/merge

@ti-chi-bot
Copy link
Member

@zhongzc: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Details

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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: 0d54eb4

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 15, 2021
@ti-chi-bot
Copy link
Member

@mornyx: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Details

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.

@zhongzc
Copy link
Contributor

zhongzc commented Oct 15, 2021

/test

@ti-chi-bot ti-chi-bot merged commit b452087 into tikv:master Oct 15, 2021
@mornyx mornyx deleted the resource-metering-framework branch December 10, 2021 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. 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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants