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

[to #421] add a python script to analyze slow log stats (#527) #534

Merged
merged 1 commit into from
Feb 22, 2022

Conversation

ti-srebot
Copy link
Collaborator

@ti-srebot ti-srebot commented Feb 22, 2022

cherry-pick #527 to release-3.1
You can switch your code base to this Pull Request by using git-extras:

# In client-java repo:
git pr https://github.com/tikv/client-java/pull/534

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/client-java.git pr/534:release-3.1-c75730e122bc

Signed-off-by: Jian Zhang zjsariel@gmail.com

What problem does this PR solve?

Issue Number: close [to #421]

Problem Description: add a python script to analyze slow log and print the stats

What is changed and how it works?

➜ ./scripts/rstats.py --help
usage: rstats.py [-h] [--order ORDER] slowlog

rstats: A TiKV Java Client Request Stats Analyzer

positional arguments:
  slowlog        slow log file

optional arguments:
  -h, --help     show this help message and exit
  --order ORDER  order the output, default: total. accepted value: total,
                 grpc, backoff

an output example:

➜ ./scripts/rstats.py ~/slow.log
Request      Start          Total Lat(ms)  Total gRPC Lat(ms)   Total Backoff Lat(ms)
putIfAbsent  22:50:36.364   868            751                  116
putIfAbsent  22:50:36.945   625            571                  46
putIfAbsent  05:23:10.665   23             0                    21
get          05:23:05.893   11             11                   0

Code changes

  • No code, only scripts

Check List for Tests

This PR has been tested by the at least one of the following methods:

  • No code

Side effects

  • NO side effects

Related changes

  • Need to cherry-pick to the release branch

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Collaborator Author

/run-all-tests

Copy link
Collaborator

@marsishandsome marsishandsome left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

❗ No coverage uploaded for pull request base (release-3.1@bbf9e19). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##             release-3.1     #534   +/-   ##
==============================================
  Coverage               ?   28.22%           
  Complexity             ?     1085           
==============================================
  Files                  ?      263           
  Lines                  ?    16525           
  Branches               ?     1892           
==============================================
  Hits                   ?     4664           
  Misses                 ?    11337           
  Partials               ?      524           

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 bbf9e19...f45799d. Read the comment docs.

@iosmanthus
Copy link
Member

LGTM

@zz-jason zz-jason merged commit 3cb9950 into tikv:release-3.1 Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants