Skip to content
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

Profiling #1674

Open
elevin72 opened this issue May 29, 2024 · 4 comments
Open

Profiling #1674

elevin72 opened this issue May 29, 2024 · 4 comments

Comments

@elevin72
Copy link

It would be a very cool/useful feature if there was a way to profile (both in memory usage, and in time) a task. This includes profiling all children tasks of a given task. What is the relationship between a task that is run, and the underlying process that it calls. Obviously I am just speaking about Linux for now

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label May 29, 2024
@trulede
Copy link

trulede commented May 29, 2024

Depending on what you are doing, the log output (-v flag IIRC) is fairly good for identifying slower tasks. AND you can always instrument the commands/processes with some additional commands.

Golang has some profiling capability, you would be able to use that without too much effort.
https://go.dev/doc/diagnostics

Eventually, most (all) Tasks result in a shell command being run. You can instrument them yourself with additional commands, or perhaps try a system profiling tool which might pickup the kind of detail you want. "top" is quite capable in that regard. "pidstat" might be even more appropriate. Redis is a very good way to aggregate runtime instrumentation (e.g. task start, end and any other output); spin up a redis container, add redis-cli commands to instrument processes/commands, run Task ... then run a script over the collected data to get some profiling results.

@pd93
Copy link
Member

pd93 commented May 29, 2024

This is an interesting idea, but I'm not convinced how in-scope this is for the main task binary. I feel like the vast majority of users would not use this feature. As mentioned above, other external tools are also capable of doing similar things.

We can leave this open to gather votes/comments, but I think it's unlikely to happen any time soon.

@pd93 pd93 added type: proposal and removed state: needs triage Waiting to be triaged by a maintainer. labels May 29, 2024
@neriaad
Copy link

neriaad commented May 30, 2024

I would find such a feature very useful since in my organization we have some massive tasks and profiling them recursively to their subtasks can be very difficult to do manually.

@trulede
Copy link

trulede commented May 30, 2024

There might be something in the new log/slog library (https://go.dev/blog/slog). There it is possible to write structured logs (i.e. JSON + custom fields). A few fields from the Task object would be sufficient to build a graph of the task execution. That would be useful in a number of cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants