-
-
Notifications
You must be signed in to change notification settings - Fork 687
feat: execution trace gantt chart #2114
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
base: main
Are you sure you want to change the base?
Conversation
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 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 |
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.
Here perhaps an interface, and then implementation for the Mermaid tracer.
type Tracer interface {
Start(task)
Stop()
...
}
@@ -221,5 +225,9 @@ func WithExecutorOptions() task.ExecutorOption { | |||
task.ExecutorWithTaskSorter(sorter), | |||
task.ExecutorWithVersionCheck(true), | |||
) | |||
|
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.
I think here, the same pattern as other executors should be used (above calls).
@@ -73,6 +73,8 @@ var ( | |||
Offline bool | |||
ClearCache bool | |||
Timeout time.Duration | |||
|
|||
ExecutionTraceOutput string |
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.
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"
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-output
flag, thentask
invocation writes contents of the gantt chart to it.