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

distsql: fix copr cache events metric #28656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

youjiali1995
Copy link
Contributor

Signed-off-by: youjiali1995 [email protected]

What problem does this PR solve?

Issue Number: close #28653
Problem Summary:

The type of copr cache events metric is wrong(histogram). It should be counter.

What is changed and how it works?

What's Changed:
Fix the metric type.

How it Works:
Before:
hit and miss are always equal even if the copr cache is disabled.
image

After:
image

Check List

Tests

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

Side effects

Documentation

Release note

None

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

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 ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 8, 2021
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@jackysp
Copy link
Member

jackysp commented Oct 8, 2021

Maybe simply change

"expr": "sum(rate(tidb_distsql_copr_cache_count{tidb_cluster=\"$tidb_cluster\"}[1m])) by (type)",
from count to sum will also fix it?

@youjiali1995
Copy link
Contributor Author

Maybe simply change

"expr": "sum(rate(tidb_distsql_copr_cache_count{tidb_cluster=\"$tidb_cluster\"}[1m])) by (type)",

from count to sum will also fix it?

Yes, but I think histogram doesn't make sense here.

Copy link
Member

@breezewish breezewish left a comment

Choose a reason for hiding this comment

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

Both Counter and Histogram make sense in some ways.

By using a counter, you can know the overall hit rate for all coprocessor requests.
By using a histogram, you can know the 95% SQL statement hit rate (if use a percentile function correctly).

@lzmhhh123 PTAL

@youjiali1995
Copy link
Contributor Author

Both Counter and Histogram make sense in some ways.

By using a counter, you can know the overall hit rate for all coprocessor requests. By using a histogram, you can know the 95% SQL statement hit rate (if use a percentile function correctly).

@lzmhhh123 PTAL

TiDB uses telemetry to record the hit rate.🤯

@ti-chi-bot
Copy link
Member

@youjiali1995: PR needs rebase.

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 added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrong copr cache metrics
4 participants