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

filter: add label for filterCounter #3320

Merged
merged 12 commits into from
Jan 14, 2021
Merged

filter: add label for filterCounter #3320

merged 12 commits into from
Jan 14, 2021

Conversation

Yisaer
Copy link
Contributor

@Yisaer Yisaer commented Jan 4, 2021

What problem does this PR solve?

What is changed and how it works?

Add label for filterCounter. If the Filter filter the target by comparing origin store and target store, we can record the origin store id into metrics.

Then we can query the metrics like this:

image

By this way, we can easily judge whether the filter is reasonable.

Check List

Tests

  • Unit test

Release note

  • No release note

Yisaer added 2 commits January 4, 2021 15:52
Signed-off-by: Song Gao <disxiaofei@163.com>
Signed-off-by: Song Gao <disxiaofei@163.com>
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 4, 2021
@ti-chi-bot ti-chi-bot requested a review from rleungx January 4, 2021 08:52
Signed-off-by: Song Gao <disxiaofei@163.com>
@codecov
Copy link

codecov bot commented Jan 4, 2021

Codecov Report

Merging #3320 (f6c42ce) into master (8eabcca) will increase coverage by 0.20%.
The diff coverage is 87.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3320      +/-   ##
==========================================
+ Coverage   74.76%   74.96%   +0.20%     
==========================================
  Files         243      243              
  Lines       23223    23246      +23     
==========================================
+ Hits        17363    17427      +64     
+ Misses       4283     4257      -26     
+ Partials     1577     1562      -15     
Flag Coverage Δ
unittests 74.96% <87.09%> (+0.20%) ⬆️

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

Impacted Files Coverage Δ
server/schedule/filter/metrics.go 100.00% <ø> (ø)
server/schedule/filter/filters.go 90.61% <87.09%> (-0.38%) ⬇️
pkg/etcdutil/etcdutil.go 84.70% <0.00%> (-3.53%) ⬇️
server/member/member.go 67.93% <0.00%> (-0.55%) ⬇️
server/tso/allocator_manager.go 76.88% <0.00%> (+0.35%) ⬆️
client/client.go 65.67% <0.00%> (+0.37%) ⬆️
server/cluster/cluster.go 83.50% <0.00%> (+0.50%) ⬆️
server/grpc_service.go 57.42% <0.00%> (+0.83%) ⬆️
server/server.go 73.41% <0.00%> (+0.94%) ⬆️
pkg/btree/btree.go 86.26% <0.00%> (+0.96%) ⬆️
... and 7 more

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 8eabcca...f6c42ce. Read the comment docs.

@Yisaer Yisaer changed the title filter: support more metrics for filters filter: add label for filterCounter Jan 4, 2021
@Yisaer
Copy link
Contributor Author

Yisaer commented Jan 5, 2021

@rleungx PTAL

@lhy1024
Copy link
Contributor

lhy1024 commented Jan 5, 2021

LGTM

Signed-off-by: Song Gao <disxiaofei@163.com>
@Yisaer Yisaer marked this pull request as ready for review January 5, 2021 10:55
@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 Jan 5, 2021
@Yisaer Yisaer added needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. needs-cherry-pick-5.0-rc component/metrics Metrics. labels Jan 5, 2021
Signed-off-by: Song Gao <disxiaofei@163.com>
@Yisaer Yisaer marked this pull request as draft January 11, 2021 02:08
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 11, 2021
@Yisaer Yisaer marked this pull request as ready for review January 12, 2021 09:10
@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 Jan 12, 2021
type ComparingFilter interface {
Filter
// GetOldStoreID returns the source store when comparing.
GetOldStoreID() uint64
Copy link
Member

Choose a reason for hiding this comment

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

Why not source store

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

Signed-off-by: Song Gao <disxiaofei@163.com>
@@ -166,6 +194,7 @@ type distinctScoreFilter struct {
stores []*core.StoreInfo
policy string
safeScore float64
oldStore uint64
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
oldStore uint64
srcStore uint64

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

Signed-off-by: Song Gao <disxiaofei@163.com>
@rleungx
Copy link
Member

rleungx commented Jan 13, 2021

BTW, I think we can add the metrics but hide it

@lhy1024
Copy link
Contributor

lhy1024 commented Jan 13, 2021

BTW, I think we can add the metrics but hide it

In some cases, we use tools to export metrics, which may not be convenient for later troubleshooting after the hidden monitoring

@Yisaer
Copy link
Contributor Author

Yisaer commented Jan 13, 2021

BTW, I think we can add the metrics but hide it

In some cases, we use tools to export metrics, which may not be convenient for later troubleshooting after the hidden monitoring

We can manually display the hidden panel, then expose the metrics.

Signed-off-by: Song Gao <disxiaofei@163.com>
Signed-off-by: Song Gao <disxiaofei@163.com>
Signed-off-by: Song Gao <disxiaofei@163.com>
Signed-off-by: Song Gao <disxiaofei@163.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 14, 2021
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jan 14, 2021
@lhy1024
Copy link
Contributor

lhy1024 commented Jan 14, 2021

/merge

@ti-chi-bot
Copy link
Member

@lhy1024: 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/ti-community-prow repository.

@ti-chi-bot
Copy link
Member

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

Commit hash: 0876018

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 14, 2021
@ti-chi-bot
Copy link
Member

Merge canceled because a new commit is pushed.

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jan 14, 2021
@ti-chi-bot
Copy link
Member

@Yisaer: Your PR has out-of-dated, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/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/ti-community-prow repository.

@Yisaer Yisaer merged commit 5f447ae into tikv:master Jan 14, 2021
ti-srebot pushed a commit to ti-srebot/pd that referenced this pull request Jan 14, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-3.0 in PR #3358

ti-srebot pushed a commit to ti-srebot/pd that referenced this pull request Jan 14, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #3359

ti-srebot pushed a commit to ti-srebot/pd that referenced this pull request Jan 14, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0-rc in PR #3360

ti-chi-bot pushed a commit that referenced this pull request Jan 26, 2021
* cherry pick #3320 to release-4.0

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

* solve conflict

Signed-off-by: Song Gao <disxiaofei@163.com>

* fix lint

Signed-off-by: Song Gao <disxiaofei@163.com>

* fix error

Signed-off-by: Song Gao <disxiaofei@163.com>

* fix error

Signed-off-by: Song Gao <disxiaofei@163.com>

Co-authored-by: Song Gao <disxiaofei@163.com>
Co-authored-by: ShuNing <nolouch@gmail.com>
ti-chi-bot added a commit that referenced this pull request Feb 2, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: Song Gao <disxiaofei@163.com>
Co-authored-by: Ti Chi Robot <71242396+ti-chi-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/metrics Metrics. needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants