Remove the additional virtual spans ThreadId(xxx)-{thread_name}
for tracing-flame
#3091
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
tracing-flame
generates a "virtual span" namedThreadId(xxx)-{thread_name}
to identify the location of a thread within a span. When the time outside a span is large, the span of actual interest to users might appear exceedingly small.The issue at hand is illustrated in the following example:
Pay attention to the line commented as
long sleep
, where the code spends much longer outside the "outer" span, which is what users are primarily concerned with.The flame-graph spawned from the previous code looks something like this:
As you can see, the
outer
span appears barely noticeable.Solution
We could remove the additional "virtual span" that is deemed unnecessary. Consequently, the flame graph for the above example ought to look more like this: