-
Notifications
You must be signed in to change notification settings - Fork 105
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
Conversation
Signed-off-by: Jian Zhang <zjsariel@gmail.com>
Signed-off-by: Jian Zhang <zjsariel@gmail.com>
/run-all-tests |
This script targets to the old slowlog format, maybe should merged into |
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.
LGTM
yes, of course. I added the 3.1 cherry-pick label. |
Codecov Report
@@ Coverage Diff @@
## master #527 +/- ##
============================================
- Coverage 32.18% 31.86% -0.32%
+ Complexity 1320 1311 -9
============================================
Files 278 278
Lines 17344 17344
Branches 1975 1975
============================================
- Hits 5582 5527 -55
- Misses 11137 11198 +61
+ Partials 625 619 -6
Continue to review full report at Codecov.
|
for line in f.readlines(): | ||
matched = re.match(pattern, line, re.M|re.I) | ||
if matched is not None: | ||
log = json.loads(line[(line.index(slowstr) + len(slowstr)):]) |
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.
What if there is a line containing corrupted JSON?
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.
the script assumes that the slow log file is generated by tikv applications without manual modifications. If it's not a JSON, it means the file is mistakenly modified by someone, the script just not working since it breaks the assumption.
Signed-off-by: Jian Zhang <zjsariel@gmail.com>
Signed-off-by: Jian Zhang <zjsariel@gmail.com>
… dev/add-rstats Signed-off-by: Jian Zhang <zjsariel@gmail.com>
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.
LGTM
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-3.1 in PR #534 |
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?
an output example:
Code changes
Check List for Tests
This PR has been tested by the at least one of the following methods:
Side effects
Related changes