Skip to content

Commit

Permalink
[7.3.0] --experimental_remote_cache_async: Profile upload events. (ba…
Browse files Browse the repository at this point in the history
…zelbuild#23082)

In the experimental_remote_cache_async mode, the
cache upload steps were not profiled, unlike in the non-async case.
This adds the profiling back.
Fixes bazelbuild#20404.

It'd be great if this could be backported into 7.3.0 once merged.

Closes bazelbuild#23056.

PiperOrigin-RevId: 655466182
Change-Id: Ib450ba4ea88a8ecdad66c6db0728db901e925017

Commit
bazelbuild@54820bd

Co-authored-by: Cornelius Riemenschneider <[email protected]>
  • Loading branch information
bazel-io and criemen authored Jul 26, 2024
1 parent 088c517 commit 333027e
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1424,18 +1424,25 @@ public void uploadOutputs(RemoteAction action, SpawnResult spawnResult)
.subscribeOn(scheduler)
.subscribe(
new SingleObserver<ActionResult>() {
long startTime = 0;

@Override
public void onSubscribe(@NonNull Disposable d) {
backgroundTaskPhaser.register();
startTime = Profiler.nanoTimeMaybe();
}

@Override
public void onSuccess(@NonNull ActionResult actionResult) {
Profiler.instance()
.completeTask(startTime, ProfilerTask.UPLOAD_TIME, "upload outputs");
backgroundTaskPhaser.arriveAndDeregister();
}

@Override
public void onError(@NonNull Throwable e) {
Profiler.instance()
.completeTask(startTime, ProfilerTask.UPLOAD_TIME, "upload outputs");
backgroundTaskPhaser.arriveAndDeregister();
reportUploadError(e);
}
Expand Down

0 comments on commit 333027e

Please sign in to comment.