Open
Conversation
trulede
reviewed
May 11, 2025
Contributor
trulede
left a comment
There was a problem hiding this comment.
This could be interesting a general technique.
For instance, a tracer could dump each tasks variables as tasks execute, making it much easier to debug Taskfiles.
| @@ -0,0 +1,83 @@ | |||
| package tracing | |||
Contributor
There was a problem hiding this comment.
Here perhaps an interface, and then implementation for the Mermaid tracer.
type Tracer interface {
Start(task)
Stop()
...
}
| task.ExecutorWithTaskSorter(sorter), | ||
| task.ExecutorWithVersionCheck(true), | ||
| ) | ||
|
|
Contributor
There was a problem hiding this comment.
I think here, the same pattern as other executors should be used (above calls).
| ClearCache bool | ||
| Timeout time.Duration | ||
|
|
||
| ExecutionTraceOutput string |
Contributor
There was a problem hiding this comment.
Might it be possible to consider a more generic operation:
# Select one tracer or the other, with default options.
task default --tracer=mermaid
task default --tracer=csv
# Select a tracer and also provide some options, without adding additional CLI parameters.
task default --tracer="mermaid;filename=foo.out"
Contributor
|
PR #2617 introduces some logging features which could be a more generalised alternative to what this PR is doing. Then it would be a matter of processing the log into the format you need with a simple script. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When debugging highly parallelized task executions, it's not immediately obvious where the bottlenecks are.
This PR allows dumping timings of the execution as Gantt chart (Mermaid syntax). Here's a sample of of a real-word invocation:
Having this makes it so much easier to understand, how well things parallelize, are tasks unnecessarily blocked, what are the major bottlenecks, etc.
Usage:
--execution-trace-outputflag, thentaskinvocation writes contents of the gantt chart to it.