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

server, statistics: support dump history stats #10291

Merged
merged 16 commits into from
May 7, 2019

Conversation

XuHuaiyu
Copy link
Contributor

What problem does this PR solve?

support dump history statistics

What is changed and how it works?

Add a new http-api tidb_ip/status_port/stats/dump/time_str to fetch history statistics specified by time_str.

e.g. tidb_ip/status_port/stats/dump/20190428173900 will fetch the statistics in 2019-04-28 17:39:00.

Check List

Tests

  • Integration test
  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported function/method change

Side effects

N/A

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

@codecov
Copy link

codecov bot commented Apr 28, 2019

Codecov Report

Merging #10291 into master will decrease coverage by 0.0145%.
The diff coverage is 69.2307%.

@@               Coverage Diff                @@
##             master     #10291        +/-   ##
================================================
- Coverage   77.3234%   77.3089%   -0.0146%     
================================================
  Files           412        412                
  Lines         85542      85571        +29     
================================================
+ Hits          66144      66154        +10     
- Misses        14383      14391         +8     
- Partials       5015       5026        +11

@XuHuaiyu
Copy link
Contributor Author

/run-all-tests

@zhouqiang-cl
Copy link
Contributor

/rebuild

@XuHuaiyu XuHuaiyu added the type/enhancement The issue or PR belongs to an enhancement. label Apr 29, 2019
@qw4990 qw4990 self-requested a review April 29, 2019 06:16
@XuHuaiyu XuHuaiyu requested review from qw4990 and alivxxx and removed request for qw4990 May 7, 2019 03:17
docs/tidb_http_api.md Show resolved Hide resolved
server/statistics_handler.go Outdated Show resolved Hide resolved
store, ok := s.driver.(*TiDBDriver)
if !ok {
panic("Illegal driver")
h.err = errors.New(fmt.Sprintf("illegal driver, excepted TiDBDriver, but got %T", s.driver))
Copy link
Member

Choose a reason for hiding this comment

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

errors.Errorf()

server/statistics_handler.go Outdated Show resolved Hide resolved
server/statistics_handler.go Outdated Show resolved Hide resolved
statistics/handle/dump.go Show resolved Hide resolved
statistics/handle/handle.go Show resolved Hide resolved
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

@XuHuaiyu
Copy link
Contributor Author

XuHuaiyu commented May 7, 2019

/run-all-tests

@XuHuaiyu XuHuaiyu added status/all tests passed status/LGT1 Indicates that a PR has LGTM 1. labels May 7, 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 May 7, 2019
@XuHuaiyu XuHuaiyu merged commit 4789904 into pingcap:master May 7, 2019
@XuHuaiyu XuHuaiyu deleted the dup_history_stats branch May 7, 2019 06:59
alivxxx pushed a commit to alivxxx/tidb that referenced this pull request Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics 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