Pass along local resource fraction to reproxy am: dbc313375a am: 3f87c8cd8b

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/19049588

Change-Id: I79014a559f1c48fb34cc62381dc95ca763a0b672
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Kousik Kumar
2022-06-28 18:29:49 +00:00
committed by Automerger Merge Worker

View File

@@ -19,6 +19,7 @@ import (
"math/rand"
"os"
"path/filepath"
"runtime"
"syscall"
"time"
@@ -87,6 +88,13 @@ func getRBEVars(ctx Context, config Config) map[string]string {
}
vars["RBE_server_address"] = fmt.Sprintf("unix://%v", name)
}
rf := 1.0
if config.Parallel() < runtime.NumCPU() {
rf = float64(config.Parallel()) / float64(runtime.NumCPU())
}
vars["RBE_local_resource_fraction"] = fmt.Sprintf("%.2f", rf)
k, v := config.rbeAuth()
vars[k] = v
return vars