-
Notifications
You must be signed in to change notification settings - Fork 607
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
fix(timeline,cobuilds): cobuilt operations should reflect the cobuild time and not cache restore time #4680
base: main
Are you sure you want to change the base?
fix(timeline,cobuilds): cobuilt operations should reflect the cobuild time and not cache restore time #4680
Conversation
libraries/rush-lib/src/logic/operations/ConsoleTimelinePlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts
Outdated
Show resolved
Hide resolved
common/changes/@microsoft/rush/sennyeya-operation-timings_2024-05-07-16-36.json
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ConsoleTimelinePlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ConsoleTimelinePlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/IOperationExecutionResult.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts
Outdated
Show resolved
Hide resolved
582ef41
to
1da8e9d
Compare
Any reason this hasn't been merged? It's a real problem trying to work out performance of co-build enabled builds 😬 |
@UberMouse Lost track of this, I was waiting on #4755 to get merged so we didn't cause more telemetry skew with this. |
@aramissennyeydd - this should be unblocked now. |
Co-authored-by: Ian Clanton-Thuon <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
77ffeee
to
44b9ff2
Compare
@iclanton This should be good for another round of 👀 🙏 |
libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Aramis Sennyey <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
Signed-off-by: Aramis Sennyey <[email protected]>
// Make sure that the stopwatch is stopped before reporting the result, otherwise endTime is undefined. | ||
this.stopwatch.stop(); |
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.
Should the stopwatch time include the before + after timings? The big issue right now is that when we go to report the times, the stopwatch hasn't ended so endTime
is undefined.
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.
Wait, why hasn't it ended? Are we bypassing the code path that would tell it to stop()?
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.
We've been calling .stop
in the finally block, which runs after onResult
, this wasn't an issue really until now since the toString
and duration
use the current time as a fallback 😞
Summary
OperationExecutionRecord
is currently only tracking cache restore time for cobuilt operations that are marked asRemoteOperating
and are then restored from cache. This is a confusing UX and causes developers + maintainers to have to search across multiple machine logs to determine operation run times. This PR adjusts that to use thenonCachedDurationMs
from the state file. This felt like something that #3649 was intending to do or is in a similar vein.Before:
After:
Details
This overwrites the existing stopwatch for operations that were not cobuilt on the specific agent. It adds a new
beforeResult
method toOperationExecutionRecord#executeAsync
to handle theafterExecuteOperation
hook instead of passing that work into theonResult
method which ended up receiving running stopwatches and had other assumptions of state (collated terminal not closed). This does add possibly breaking behavior where cobuilds were showing cache times which might be useful, but I don't think those are as useful as having the cobuild time available across all agents. That also has the secondary effect of making the timeline views of all agents much more cohesive - though as we see above they're not the exact same across agents.How it was tested
I tested this locally using the
build-tests/rush-redis-cobuild-plugin-integration-test
sandbox repo with 2 runners, confirmed that timings generally matched across the instances. There's about 10ms (rounded up) of difference between the agents, but this already seems much more useful.Impacted documentation
None