forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split SpawnMetrics into two classes to reduce memory footprint.
PiperOrigin-RevId: 545947586 Change-Id: I88cb1abe4cddd4a69421fef2364ad53486068593
- Loading branch information
1 parent
d6cefac
commit 3f8bab9
Showing
3 changed files
with
197 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/main/java/com/google/devtools/build/lib/actions/FullSpawnMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright 2018 The Bazel Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package com.google.devtools.build.lib.actions; | ||
|
||
|
||
/** Includes limits to SpawnMetrics, if set. */ | ||
@SuppressWarnings("GoodTime") // Use ints instead of Durations to improve build time (cl/505728570) | ||
public final class FullSpawnMetrics extends SpawnMetrics { | ||
|
||
private final long inputBytesLimit; | ||
private final long inputFilesLimit; | ||
private final long outputBytesLimit; | ||
private final long outputFilesLimit; | ||
private final long memoryBytesLimit; | ||
private final int timeLimitInMs; | ||
|
||
FullSpawnMetrics(Builder builder) { | ||
super(builder); | ||
this.inputBytesLimit = builder.inputBytesLimit; | ||
this.inputFilesLimit = builder.inputFilesLimit; | ||
this.outputBytesLimit = builder.outputBytesLimit; | ||
this.outputFilesLimit = builder.outputFilesLimit; | ||
this.memoryBytesLimit = builder.memoryBytesLimit; | ||
this.timeLimitInMs = builder.timeLimitInMs; | ||
} | ||
|
||
/** Limit of total size in bytes of inputs or 0 if unavailable. */ | ||
@Override | ||
public long inputBytesLimit() { | ||
return inputBytesLimit; | ||
} | ||
|
||
/** Limit of total number of input files or 0 if unavailable. */ | ||
@Override | ||
public long inputFilesLimit() { | ||
return inputFilesLimit; | ||
} | ||
|
||
/** Limit of total size in bytes of outputs or 0 if unavailable. */ | ||
@Override | ||
public long outputBytesLimit() { | ||
return outputBytesLimit; | ||
} | ||
|
||
/** Limit of total number of output files or 0 if unavailable. */ | ||
@Override | ||
public long outputFilesLimit() { | ||
return outputFilesLimit; | ||
} | ||
|
||
/** Memory limit or 0 if unavailable. */ | ||
@Override | ||
public long memoryLimit() { | ||
return memoryBytesLimit; | ||
} | ||
|
||
/** Time limit in milliseconds or 0 if unavailable. */ | ||
@Override | ||
public int timeLimitInMs() { | ||
return timeLimitInMs; | ||
} | ||
|
||
} |
Oops, something went wrong.