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

resource_control: add runaway metrics #47360

Merged

Conversation

CabinfeverB
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #43691

Problem Summary:

What is changed and how it works?

  1. add metrics for runaway manager.

  2. format the resource-control grafana json.

Check List

Tests

  • Unit test

  • Integration test

  • Manual test (add detailed scripts or steps below)
    image

  • No need to test

    • I checked and no code files have been changed.

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: Cabinfever_B <cabinfeveroier@gmail.com>
@ti-chi-bot ti-chi-bot bot added 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. labels Sep 28, 2023
@tiprow
Copy link

tiprow bot commented Sep 28, 2023

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

@CabinfeverB
Copy link
Contributor Author

cc @nolouch @glorv

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 28, 2023
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Merging #47360 (0b3db5c) into master (91a8023) will increase coverage by 1.7845%.
Report is 26 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #47360        +/-   ##
================================================
+ Coverage   71.8856%   73.6701%   +1.7845%     
================================================
  Files          1398       1426        +28     
  Lines        405057     422954     +17897     
================================================
+ Hits         291178     311591     +20413     
+ Misses        94273      92261      -2012     
+ Partials      19606      19102       -504     
Flag Coverage Δ
integration 42.5369% <55.0000%> (?)
unit 72.8690% <100.0000%> (+0.9833%) ⬆️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser ∅ <ø> (∅)
br 49.2065% <ø> (-3.7746%) ⬇️

@@ -252,6 +253,7 @@ func (rm *RunawayManager) DeriveChecker(resourceGroupName, originalSQL, sqlDiges
if group.RunawaySettings == nil && rm.activeGroup[resourceGroupName] == 0 {
return nil
}
metrics.RunawayCheckerCounter.WithLabelValues(resourceGroupName, "hit", "").Inc()
Copy link
Member

Choose a reason for hiding this comment

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

It's better to remove WithLabelValues. in most cases, the group name is not changed.

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@CabinfeverB
Copy link
Contributor Author

PTAL @nolouch

@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: glorv, nolouch

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 Oct 19, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 19, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-28 08:36:42.977403983 +0000 UTC m=+91000.564514128: ☑️ agreed by glorv.
  • 2023-10-19 06:33:56.975484122 +0000 UTC m=+1898034.562594267: ☑️ agreed by nolouch.

@glorv
Copy link
Contributor

glorv commented Oct 19, 2023

/test mysql-test

@tiprow
Copy link

tiprow bot commented Oct 19, 2023

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

In response to this:

/test mysql-test

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.

@ti-chi-bot ti-chi-bot bot merged commit af7b32c into pingcap:master Oct 19, 2023
14 of 16 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/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