[to #421] add a python script to analyze slow log stats#527
[to #421] add a python script to analyze slow log stats#527zz-jason merged 9 commits intotikv:masterfrom
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 |
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.
What if there is a line containing corrupted JSON?
There was a problem hiding this comment.
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>
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