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

[SuggestionProvider] Suggest investigating remote cache misses #126

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

saraadams
Copy link
Collaborator

If remote caching is used and there are remote cache misses, suggest investigating the misses with a link to Bazel documentation.

Contributes to #90

@saraadams
Copy link
Collaborator Author

Example output:

Suggestion: "Investigate remote cache misses"
The following actions with cache misses took the longest to execute:
	- Action: "Copying directory external/npm/_/node_modules/date-fns [for tool]"
		Action duration: 52s
	- Action: "Copying directory external/npm/_/node_modules/date-fns"
		Action duration: 51s
	- Action: "Copying directory external/npm/_/node_modules/rxjs"
		Action duration: 46s
	- Action: "Copying directory external/npm/_/node_modules/@material-ui/core [for tool]"
		Action duration: 42s
	- Action: "Copying directory external/npm/_/node_modules/@material-ui/core"
		Action duration: 41s
Check https://bazel.build/remote/cache-remote#troubleshooting-cache-hits to learn more about how to debug remote cache misses. Increasing the cache hit rate can significantly speed up builds.
Caveats
- Only the first 5 of 6125 cache misses are listed. Try running this tool with --verbose to get more data.

@saraadams saraadams force-pushed the sara-investigate-remote-cache-misses branch from 69a8c66 to 98a933e Compare November 26, 2023 00:20
@saraadams saraadams force-pushed the sara-refactor-extract-completeeventutil branch from bd9ed5b to ca2fb3f Compare November 27, 2023 14:00
Base automatically changed from sara-refactor-extract-completeeventutil to main November 27, 2023 14:17
@laszlocsomor
Copy link

Could you rebase on main and force-push please?

If remote caching is used and there are remote cache misses, suggest
investigating the misses with a link to Bazel documentation.

Contributes to #90

Signed-off-by: Sara Adams <sara.e.adams@gmail.com>
@saraadams saraadams force-pushed the sara-investigate-remote-cache-misses branch from 98a933e to 5b8c9ae Compare November 27, 2023 14:36

import com.engflow.bazel.invocation.analyzer.traceeventformat.CompleteEvent;

public class BazelEventsUtil {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class BazelEventsUtil {
public final class BazelEventsUtil {

...because this is a utility class with a private ctor, so I reckon we don't mean to subclass it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you only saw that file, because I hadn't rebased to main yet.

Signed-off-by: Sara Adams <sara.e.adams@gmail.com>
@saraadams
Copy link
Collaborator Author

Rebased and addressed TODOs. PTAL.

@saraadams
Copy link
Collaborator Author

Example output with target name caveat:

Suggestion: "Investigate remote cache misses"
The following actions with cache misses took the longest to execute:
[...]
Check https://bazel.build/remote/cache-remote#troubleshooting-cache-hits to learn more about how to debug remote cache misses. Increasing the cache hit rate can significantly speed up builds.
Caveats
- The profile does not include which target each action was processed for, although that data can help with investigating remote cache misses. It is added to the profile by using the Bazel flag `--experimental_profile_include_target_label`. Also see https://bazel.build/reference/command-line-reference#flag--experimental_profile_include_target_label

@saraadams saraadams merged commit 57fe04a into main Nov 27, 2023
3 checks passed
@saraadams saraadams deleted the sara-investigate-remote-cache-misses branch November 27, 2023 15:19
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

Successfully merging this pull request may close these issues.

2 participants