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_manage/metrics: change histogram to vector #6332

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Apr 18, 2023

What problem does this PR solve?

Issue Number: Close #6066

What is changed and how does it work?

resource_manage/metrics: change histogram to vector

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Release note

None.

image

Signed-off-by: husharp <jinhao.hu@pingcap.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Apr 18, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bufferflies
  • nolouch

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.

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

@ti-chi-bot
Copy link
Member

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot added 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. labels Apr 18, 2023
@ti-chi-bot ti-chi-bot requested review from HunDunDM and nolouch April 18, 2023 06:02
@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Patch coverage: 73.87% and project coverage change: +0.02 🎉

Comparison is base (574461f) 75.08% compared to head (a130b19) 75.10%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6332      +/-   ##
==========================================
+ Coverage   75.08%   75.10%   +0.02%     
==========================================
  Files         408      408              
  Lines       40704    40783      +79     
==========================================
+ Hits        30563    30631      +68     
- Misses       7489     7501      +12     
+ Partials     2652     2651       -1     
Flag Coverage Δ
unittests 75.10% <73.87%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
pkg/mcs/resource_manager/server/metrics.go 100.00% <ø> (ø)
server/apiv2/handlers/tso_keyspace_group.go 58.70% <70.96%> (+1.67%) ⬆️
pkg/keyspace/tso_keyspace_group.go 68.59% <72.22%> (-0.95%) ⬇️
pkg/mcs/resource_manager/server/manager.go 82.51% <100.00%> (ø)
pkg/tso/keyspace_group_manager.go 76.62% <100.00%> (+1.08%) ⬆️

... and 26 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@HuSharp HuSharp marked this pull request as ready for review April 19, 2023 06:30
@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 Apr 19, 2023
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@nolouch
Copy link
Contributor

nolouch commented Apr 20, 2023

Do u check the metrics upgrade old from new?

@HuSharp
Copy link
Member Author

HuSharp commented Apr 20, 2023

Do u check the metrics upgrade old from new?

I don't get what you mean, can you elaborate a bit? :) @nolouch
Just need to update server's metrics, so I just reboot a new pd-server with this pr to check the metrics panel's work.

}
kvCPUMetrics.Observe(consumption.TotalCpuTimeMs - consumption.SqlLayerCpuTimeMs)
kvCPUMetrics.Add(consumption.TotalCpuTimeMs - consumption.SqlLayerCpuTimeMs)
Copy link
Contributor

@bufferflies bufferflies Apr 21, 2023

Choose a reason for hiding this comment

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

The condition of TotalCpuTimeMs less than SqlLayerCpuTimeMs is always true. if not, it maybe panic.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, TotalCpuTimeMs includes SqlLayerCpuTimeMs.

@nolouch
Copy link
Contributor

nolouch commented Apr 24, 2023

@HuSharp
I mean to test the upgrade case to check the metrics is this modification is compatible with before.

Copy link
Contributor

@nolouch nolouch 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 ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 24, 2023
@bufferflies
Copy link
Contributor

Does the grafana panel need to update also?

@HuSharp
Copy link
Member Author

HuSharp commented Apr 26, 2023

Does the grafana panel need to update also?

No need. This is why we need to add the _sum suffix to keep compatible with the previous json names @bufferflies

@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 26, 2023
@nolouch
Copy link
Contributor

nolouch commented Apr 26, 2023

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Apr 26, 2023

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

/run-all-tests

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
Contributor

ti-chi-bot bot commented Apr 26, 2023

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

Commit hash: a130b19

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 26, 2023
@ti-chi-bot ti-chi-bot bot merged commit 6ea70e6 into tikv:master Apr 26, 2023
@HuSharp HuSharp deleted the change_histogram_to_vec branch April 26, 2023 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. 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.

metrics: consider replace resource manager related histogram with counter
5 participants