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

stats: add metircs for high error rate feedback #9209

Merged
merged 6 commits into from
Feb 12, 2019

Conversation

winoros
Copy link
Member

@winoros winoros commented Jan 29, 2019

What problem does this PR solve?

Add metrics to count the case when the actual count got by feedback is much different from the expected count calculated by statistics.

Check List

Tests

  • No code

Related changes

  • Need to update the tidb-ansible repository

@codecov-io
Copy link

codecov-io commented Jan 29, 2019

Codecov Report

Merging #9209 into master will increase coverage by 0.01%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9209      +/-   ##
==========================================
+ Coverage   67.22%   67.23%   +0.01%     
==========================================
  Files         371      371              
  Lines       77268    77271       +3     
==========================================
+ Hits        51941    51953      +12     
+ Misses      20684    20680       -4     
+ Partials     4643     4638       -5
Impacted Files Coverage Δ
metrics/metrics.go 0% <0%> (ø) ⬆️
statistics/update.go 83.97% <100%> (+0.06%) ⬆️
infoschema/infoschema.go 76.31% <0%> (-1.32%) ⬇️
executor/executor.go 67.31% <0%> (+0.27%) ⬆️
store/tikv/lock_resolver.go 42.65% <0%> (+0.94%) ⬆️
ddl/delete_range.go 79.36% <0%> (+4.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 347c852...b52003f. Read the comment docs.

metrics/stats.go Outdated Show resolved Hide resolved
q.logDetailedInfo(h)
if rate >= MinLogErrorRate && (q.actual >= MinLogScanCount || q.expected >= MinLogScanCount) {
metrics.HighErrorRateFeedBackCounter.Inc()
if log.GetLevel() == log.DebugLevel {
Copy link
Member

Choose a reason for hiding this comment

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

Can we change this log level to INFO or WARN?

Copy link
Member Author

Choose a reason for hiding this comment

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

This part logs many things and has some heavy calculation. So it would be better to set it to debug level.

prometheus.CounterOpts{
Namespace: "tidb",
Subsystem: "statistics",
Name: "high_error_rate_feedback_total",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we update ansible as well?

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.

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 12, 2019
Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@alivxxx alivxxx added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 12, 2019
@winoros winoros merged commit 8431d11 into pingcap:master Feb 12, 2019
@winoros winoros deleted the fb-metrics branch February 12, 2019 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants