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

statistics: fix region flow calculation #1688

Merged
merged 5 commits into from
Sep 9, 2019

Conversation

jiyingtk
Copy link
Contributor

What problem does this PR solve?

Region flow statistics would be inaccurate when transfer leader occurs.

What is changed and how it works?

Use time interval reported from region heartbeat to calculate flow.

Check List

Tests

  • Manual test

* use report time interval to calculate flow

Signed-off-by: jiyingtk <jiyingtk@mail.ustc.edu.cn>
@sre-bot
Copy link
Contributor

sre-bot commented Aug 16, 2019

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

Signed-off-by: jiyingtk <jiyingtk@mail.ustc.edu.cn>
server/core/region.go Outdated Show resolved Hide resolved
Signed-off-by: jiyingtk <jiyingtk@mail.ustc.edu.cn>
@codecov-io
Copy link

codecov-io commented Aug 19, 2019

Codecov Report

Merging #1688 into master will increase coverage by 0.14%.
The diff coverage is 76.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1688      +/-   ##
==========================================
+ Coverage   76.93%   77.07%   +0.14%     
==========================================
  Files         161      161              
  Lines       15724    15741      +17     
==========================================
+ Hits        12097    12133      +36     
+ Misses       2619     2597      -22     
- Partials     1008     1011       +3
Impacted Files Coverage Δ
server/core/region_option.go 83.33% <100%> (+0.5%) ⬆️
pkg/mock/mockcluster/mockcluster.go 91.81% <100%> (+0.05%) ⬆️
server/core/region.go 93.15% <100%> (+0.06%) ⬆️
server/statistics/hot_cache.go 78.37% <63.15%> (-1.31%) ⬇️
server/kv/etcd_kv.go 79.22% <0%> (-3.9%) ⬇️
server/statistics/store.go 94.11% <0%> (-1.97%) ⬇️
server/tso/tso.go 78.89% <0%> (-1.84%) ⬇️
client/client.go 68.89% <0%> (-1.52%) ⬇️
server/server.go 82.21% <0%> (-0.58%) ⬇️
server/schedule/operator/operator.go 85.04% <0%> (-0.55%) ⬇️
... and 8 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 b66ba44...e2c7613. Read the comment docs.

jiyingtk and others added 2 commits September 9, 2019 10:09
Signed-off-by: jiyingtk <jiyingtk@mail.ustc.edu.cn>
@nolouch nolouch added the type/enhancement The issue or PR belongs to an enhancement. label Sep 9, 2019
@nolouch nolouch added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 9, 2019
@rleungx rleungx added the status/can-merge Indicates a PR has been approved by a committer. label Sep 9, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 9, 2019

/run-all-tests

@rleungx rleungx added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 9, 2019
@sre-bot sre-bot merged commit c7c572a into tikv:master Sep 9, 2019
Luffbee added a commit that referenced this pull request Sep 11, 2019
* *: unify get store function everywhere (#1671)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

*  server: use leader lease to determine tso service validity (#1676)

Signed-off-by: disksing <i@disksing.com>

* test: fix tests (#1696)

* test: fix region syncer test

Signed-off-by: disksing <i@disksing.com>

* add config-check flag for pd-server (#1695)

Signed-off-by: cwen0 <cwenyin0@gmail.com>

* operator: rewrite move region related functions (#1667)

* *: support setting endKey for ScanRange (#1700)

Signed-off-by: disksing <i@disksing.com>

* *: reduce some unnecessary parameters (#1698)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* schedule: Do not send an operator of a region wth a stale epoch (#1659)

* schedule: Do not send an operator of a region wth a stale epoch

Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>

* schedule: check the version changed by the operator self

Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>

* schedule: fix unit test

Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>

* schedule: fix to avoid dispatching a stale opstep

Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>

* dispatch: refactor "ConsumeConfVer() int" to "ExpectConfVerChange() bool"

Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>

* dispatch: fix typo in comment

Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>

* fix typo

Co-Authored-By: Ryan Leung <rleungx@gmail.com>

* dispatch: fix unittest

Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>

* dispatch: refine format

Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>

* server: fix the dead lock in scatter region (#1706)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* tools: fix set namespace in pd-ctl (#1701)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* tools: fix parse url without http prefix (#1703)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* tests: support deadlock detection in make test (#1704)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* Makefile: fix failpoint enable (#1722)

Signed-off-by: nolouch <nolouch@gmail.com>

* checker: fix the issue that a region does not merge to the sibling with smaller size (#1723)

Signed-off-by: disksing <i@disksing.com>

* tools: balance region simulator (#1708)

* scheduler: do not remove the operator when the step does not finish (#1715)

Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>

* operator: fix the AddLearner config version judgment (#1732)

Signed-off-by: nolouch <nolouch@gmail.com>

* tools: fix TLS in pd control (#1729)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* syncer: support TLS for region syncer (#1728)

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* schedule: fix a thread-safe bug and improve code (#1719)

* statistics: fix region flow calculation (#1688)

Signed-off-by: jiyingtk <jiyingtk@mail.ustc.edu.cn>

* makefile: improve deadlock-enable/disable (#1736)

* api: fix missing keys statistic in region information (#1741)

Signed-off-by: nolouch <nolouch@gmail.com>

* *: update go version to 1.13 (#1742)

Signed-off-by: disksing <i@disksing.com>

* coordinator: add the operator cost time in log field (#1748)

Signed-off-by: nolouch <nolouch@gmail.com>
@Luffbee Luffbee mentioned this pull request Nov 1, 2019
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants