-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
infoschema: add metric database/table to query cluster metric table. #13757
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13757 +/- ##
===========================================
Coverage ? 80.0891%
===========================================
Files ? 487
Lines ? 121431
Branches ? 0
===========================================
Hits ? 97253
Misses ? 16435
Partials ? 7743 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed IsMemOrSysDB
in util/misc.go
.
/run-all-tests |
/run-all-tests tidb-test=pr/968 |
/run-common-test tidb-test=pr/968 |
/run-all-tests tidb-test=pr/968 |
/run-integration-copr-test tidb-test=pr/968 |
/run-common-test tidb-test=pr/968 |
/run-all-tests tidb-test=pr/968 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests tidb-test=pr/968 |
/run-all-tests tidb-test=pr/968 |
/run-integration-copr-test tidb-test=pr/968 |
What problem does this PR solve?
tidb_metric_schema_range_duration
, the query duration, it will affect the generated promQL.tidb_metric_schema_step
, the query step time, it will affect the step value when query promQL.release test PR:https://github.com/pingcap/tidb-test/pull/968, merge test first.
You can use
explain
to check the generated promQL too:What is changed and how it works?
Actually, we use
promQL
to query metric data. Every metric table has a relatedpromQL
.Such as
query_duration
metric table, there is a definition in code:Then TiDB will generate a metric table as below:
As you can see, there is 3 variable in
promQL
, it will be replaced when execute SQL query:If you execute below SQL:
It will generated a promQL as below:
The
$QUANTILE
and$RANGE_DURATION
is0.90
,60s
, it's the session variable value oftidb_metric_schema_range_duration
.Then send the
promQL
to PD to query metric data which between in the "2019-11-25 00:00:00" and "2019-11-25 00:01:00".Attension
Actually the variable in the
promQL
will always use the default value, use the value specified in SQL will be finished in the next PR.Check List
Tests
Code changes
Side effects
Related changes
Release note