-
Notifications
You must be signed in to change notification settings - Fork 753
statistics: Add 'store' label to metric pd_cluster_status. #9898
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,22 +76,7 @@ func TestStoreStatistics(t *testing.T) { | |
| ObserveHotStat(store, storesStats) | ||
| } | ||
| stats := storeStats.stats | ||
| tikvStats := stats.engineStatistics[core.EngineTiKV] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to add a new test for it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lhy1024 |
||
|
|
||
| re.Equal(6, tikvStats.Up) | ||
| re.Equal(7, tikvStats.Preparing) | ||
| re.Equal(0, tikvStats.Serving) | ||
| re.Equal(1, tikvStats.Removing) | ||
| re.Equal(1, tikvStats.Removed) | ||
| re.Equal(1, tikvStats.Down) | ||
| re.Equal(1, tikvStats.Offline) | ||
| re.Equal(0, stats.RegionCount) | ||
| re.Equal(0, stats.WitnessCount) | ||
| re.Equal(0, tikvStats.Unhealthy) | ||
| re.Equal(0, tikvStats.Disconnect) | ||
| re.Equal(1, tikvStats.Tombstone) | ||
| re.Equal(1, tikvStats.LowSpace) | ||
| re.Equal(1, stats.engineStatistics[core.EngineTiFlash].Up) | ||
|
|
||
| re.Len(stats.LabelCounter["zone:z1"], 2) | ||
| re.Equal([]uint64{1, 2}, stats.LabelCounter["zone:z1"]) | ||
| re.Len(stats.LabelCounter["zone:z2"], 2) | ||
|
|
@@ -100,7 +85,6 @@ func TestStoreStatistics(t *testing.T) { | |
| re.Equal([]uint64{1, 3, 5, 7}, stats.LabelCounter["host:h1"]) | ||
| re.Len(stats.LabelCounter["host:h2"], 4) | ||
| re.Len(stats.LabelCounter["zone:unknown"], 2) | ||
| re.Equal(0, stats.LeaderCount) | ||
| } | ||
|
|
||
| func TestSummaryStoreInfos(t *testing.T) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // Copyright 2020 TiKV Project Authors. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package utils | ||
|
|
||
| import "github.com/prometheus/client_golang/prometheus" | ||
|
|
||
| // SingleLabel build a labels map containing only a single label | ||
| func SingleLabel(key, value string) prometheus.Labels { | ||
| return prometheus.Labels{key: value} | ||
| } |
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.
Do we need to update
metrics/grafana/pd.json?Uh oh!
There was an error while loading. Please reload this page.
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.
@lhy1024
I don't think so. All queries for
pd_cluster_statusmetrics already aggregate that metric with sum(). Thus, there should no be any changes there. The description of that metrics should be updated, but I wasn't able to find doc describing metrics in this repo.