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

Feature Request: Add an option to log task timings #2548

Open
chrisguest75 opened this issue Dec 23, 2024 · 2 comments
Open

Feature Request: Add an option to log task timings #2548

chrisguest75 opened this issue Dec 23, 2024 · 2 comments

Comments

@chrisguest75
Copy link

I'm trying to find a nice pattern to log out task timings. I'm using just for various processes and I have cases where I'd like to understand the impact of cmd switch on performance.

I've just come up with this way of logging out the timestamps, but it is a bit manual and messy. The alternative is use an external tool an annotate the justfile.

It would be good for just to summarise at least the top level task execution stats or a graph in a json file if you wanted to support a full breakdown.

just --timestamp mytask
_start_task name="":
  echo "Start {{ name}}"

_end_task name="":
  echo "End {{ name }}"

mytask: (_start_task 'mytask') && (_end_task 'mytask')
  #!/usr/bin/env bash
  set -eufo pipefail
  tool --slow-switch

Thanks for such a cool project. It's really changing the way I document my tiny projects.

@casey
Copy link
Owner

casey commented Dec 23, 2024

Maybe there could be a config option which would log a JSON summary of a just invocation to a file.

One quick and dirty thing you could do in meantime is use strace to log syscalls, look for process invocations, and figure out the timings from that.

Thanks for such a cool project. It's really changing the way I document my tiny projects.

Glad you like it! ☺️

@chrisguest75
Copy link
Author

Another thing maybe to OTEL enable it. I mean this would open up a whole world of possibilities for monitoring build pipelines and any subprocesses that are also OTEL enabled.

Scope Creeping already :D

One quick and dirty thing you could do in meantime is use strace to log syscalls, look for process invocations, and figure out the timings from that.

Currently I'm using time like this -> time just mytask

Thanks for the quick reply.

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

2 participants