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

[rush] Experimental: task runner ASCII timeline generator #3139

Closed

Conversation

elliot-nelson
Copy link
Collaborator

@elliot-nelson elliot-nelson commented Jan 6, 2022

Summary

Once the upcoming "phased builds" feature is rolled out, monorepo maintainers will want to try it out. I think there's two big questions that will get asked: (1) am I configuring these phases correctly? (2) am I getting enough value out of this extra configuration?

Being able to see visually what was built can often highlight questions to go explore in your own configuration, and some additional summary details can highlight what changes you might want to make to the structure of projects in the repo to get better performance out of your phases.

This PR is an example to show the proposed output, and is not yet cleaned up.

Details

This PR currently writes out a simple text file to contain the additional graph, but that's actually not ideal, because what you really want as a maintainer is to notice a build that had a long duration yesterday, click on it, and see what happened in the timeline. So maybe a --timeline option that spits it out at the end of the build to stdout would be preferred.

Example sanitized outputs:

========================================================================================================================
@hbo/xxx-xxxx-xxx (compile)            %%--------------------------------------------------------------------------- 0s
@hbo/xxxxxx-xxxxxx-xxxxxxxxx (compile) -%--------------------------------------------------------------------------- 0s
@hbo/xxx-xxxx-xxx (test)               -%--------------------------------------------------------------------------- 0s
@hbo/xxxxxx-xxxxxx-xxxxx (compile)     -%--------------------------------------------------------------------------- 0s
@hbo/xxxxx-xxxxxxx-xxxxxxxxx (test)    -%--------------------------------------------------------------------------- 0s
@hbo/xxxx-xxxxx (compile)              -!!!!!!!!!!!!!!!!!----------------------------------------------------------- 7s
@hbo/xxxxxx-xxxxxx-xxxxx (test)        -%--------------------------------------------------------------------------- 0s
@hbo/xxxx-xxxxx (test)                 -----------------############################################################ 26s
========================================================================================================================
LEGEND:                                                                                            Total Work:       34s
  [#] Success  [!] Failed/warnings  [%] Skipped/cached                                             Wall Clock:       34s
                                                                                             Parallelism Used:      3/16
TIMELINE
========================================================================================================================
@hbo/hbo-node-rig (compile)            #######---------------------------------------------------------------------- 1s
@hbo/eslint-plugin-lightning (compile) ------####################--------------------------------------------------- 4s
@hbo/hbo-node-rig (test)               ------#---------------------------------------------------------------------- 0s
@hbo/eslint-config-codex (compile)     -------------------------###------------------------------------------------- 0s
@hbo/eslint-plugin-lightning (test)    -------------------------#################################################### 11s
@hbo/install-apple-profiles (compile)  ---------------------------##############------------------------------------ 2s
@hbo/eslint-config-codex (test)        ---------------------------#------------------------------------------------- 0s
@hbo/install-apple-profiles (test)     ----------------------------------------##################------------------- 3s
========================================================================================================================
LEGEND                                                                                             Total Work:       24s
  [#] Success  [!] Failed/warnings  [%] Skipped/cached                                             Wall Clock:       17s
                                                                                             Parallelism Used:      3/16

PHASE BREAKDOWN
  _phase:compile        9s
  _phase:test          15s

Alternate approaches

An alternate approach (maybe technically better) would be #2569. However, to use this, you really need to configure your pipelines ahead of time to always trace and always save the trace artifact as a build output, otherwise you won't have it when you need it. (Maybe that PR might add "--trace", and it could generate the ASCII graph in addition to the event format output?)

How it was tested

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

Successfully merging this pull request may close these issues.

1 participant