-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: improve trace format='row' #9029
Conversation
mysql> trace format='row' select * from trace where id = 0; +---------------------------+-----------------+------------+ | operation | startTS | duration | +---------------------------+-----------------+------------+ | session.getTxnFuture | 22:08:38.247834 | 78.909µs | | ├─session.Execute | 22:08:38.247829 | 1.478487ms | | ├─session.ParseSQL | 22:08:38.248457 | 71.159µs | | ├─executor.Compile | 22:08:38.248578 | 45.329µs | | ├─session.runStmt | 22:08:38.248661 | 75.13µs | | ├─session.CommitTxn | 22:08:38.248699 | 13.213µs | | └─recordSet.Next | 22:08:38.249340 | 155.317µs | +---------------------------+-----------------+------------+ 7 rows in set (0.01 sec)
c2896eb
to
59e0d0f
Compare
Codecov Report
@@ Coverage Diff @@
## master #9029 +/- ##
==========================================
+ Coverage 67.58% 67.63% +0.05%
==========================================
Files 364 364
Lines 75477 75471 -6
==========================================
+ Hits 51011 51047 +36
+ Misses 19973 19927 -46
- Partials 4493 4497 +4
Continue to review full report at Codecov.
|
/run-all-tests |
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
PTAL @lysu
} | ||
|
||
chk.AppendString(0, prefix+suffix+t.Span.Name()) | ||
chk.AppendString(1, start.Format("15:04:05.000000")) |
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.
It is OK for me, but "15:04:05.000000" is still a little strange.
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.
This control the time format output.
Go use pattern match to control the output format, https://godoc.org/time#Parse
And the layout string always use this date: 2006 01 02 15 04 05, it's a special number
if you want the result looks like "hh:mm:ss.xxxxxx" , the layout should be "15:04:05.000000"
/run-all-tests |
/run-all-tests tidb-test=pr/715 |
/run-all-tests |
LGTM to current code, but maybe more refine the span name in the next @tiancaiamao
from this two table with same name we don't know which table have question, also miss join execution info, and maybe trace insert is useful too. |
/run-all-tests tidb-test=pr/715 |
/run-common-test tidb-test=pr/715 |
/run-common-test |
/run-common-test tidb-test=pr/716 |
What problem does this PR solve?
In #8357, the trace result is in json format, used by web UI.
This commit add a row format for it, which look like this:
What is changed and how it works?
Write the trace result to chunk in row format.
There are some small pitfalls I'll investigate later:
We support
trace format='json' ...
andtrace format='row' ...
Maybe I should also make format=row the default one.
Check List
Tests
Related changes