use of com.google.devtools.build.lib.exec.ExecutionOptions in project bazel by bazelbuild.
the class ExecutionTool method configureResourceManager.
private void configureResourceManager(BuildRequest request) {
ResourceManager resourceMgr = ResourceManager.instance();
ExecutionOptions options = request.getOptions(ExecutionOptions.class);
ResourceSet resources;
if (options.availableResources != null) {
resources = options.availableResources;
resourceMgr.setRamUtilizationPercentage(100);
} else {
resources = LocalHostCapacity.getLocalHostCapacity();
resourceMgr.setRamUtilizationPercentage(options.ramUtilizationPercentage);
}
resourceMgr.setAvailableResources(ResourceSet.create(resources.getMemoryMb(), resources.getCpuUsage(), resources.getIoUsage(), request.getExecutionOptions().usingLocalTestJobs() ? request.getExecutionOptions().localTestJobs : Integer.MAX_VALUE));
}
use of com.google.devtools.build.lib.exec.ExecutionOptions in project bazel by bazelbuild.
the class CacheFileDigestsModule method executorInit.
@Override
public void executorInit(CommandEnvironment env, BuildRequest request, ExecutorBuilder builder) {
super.executorInit(env, request, builder);
ExecutionOptions options = request.getOptions(ExecutionOptions.class);
if (lastKnownCacheSize == null || options.cacheSizeForComputedFileDigests != lastKnownCacheSize) {
log.info("Reconfiguring cache with size=" + options.cacheSizeForComputedFileDigests);
DigestUtils.configureCache(options.cacheSizeForComputedFileDigests);
lastKnownCacheSize = options.cacheSizeForComputedFileDigests;
}
if (options.cacheSizeForComputedFileDigests == 0) {
stats = null;
log.info("Disabled cache");
} else {
stats = DigestUtils.getCacheStats();
logStats("Accumulated cache stats before command", stats);
}
}
Aggregations