Skip to content

Commit

Permalink
--experimental_remote_cache_async: Profile upload events.
Browse files Browse the repository at this point in the history
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 #20404.

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

Closes #23056.

PiperOrigin-RevId: 655466182
Change-Id: Ib450ba4ea88a8ecdad66c6db0728db901e925017
  • Loading branch information
criemen authored and copybara-github committed Jul 24, 2024
1 parent 94d2b3e commit 54820bd
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1572,19 +1572,26 @@ public void uploadOutputs(RemoteAction action, SpawnResult spawnResult, Runnable
.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();
onUploadComplete.run();
}

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

0 comments on commit 54820bd

Please sign in to comment.