diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/profiler/analysis/ProfileInfo.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/profiler/analysis/ProfileInfo.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/profiler/analysis/ProfileInfo.java b/src/main/java/com/google/devtools/build/lib/profiler/analysis/ProfileInfo.java index 5050eb4436..4eb7f6e115 100644 --- a/src/main/java/com/google/devtools/build/lib/profiler/analysis/ProfileInfo.java +++ b/src/main/java/com/google/devtools/build/lib/profiler/analysis/ProfileInfo.java @@ -444,6 +444,7 @@ public class ProfileInfo { private static final AggregateAttr ZERO = new AggregateAttr(0, 0); public final String comment; + private long minTaskStartTime = Long.MAX_VALUE; private boolean corruptedOrIncomplete = false; // TODO(bazel-team): (2010) In one case, this list took 277MB of heap. Ideally it should be @@ -475,6 +476,7 @@ public class ProfileInfo { private void addTask(Task task) { allTasksById.add(task); + minTaskStartTime = Math.min(minTaskStartTime, task.startTime); } /** @@ -625,6 +627,16 @@ public class ProfileInfo { } /** + * Returns the minimum task start time, that is, when the profile actually started. + * + * <p>This should be very close to zero except that some Blaze versions contained a bug that made + * them not subtract the current time from task start times in the profile.</p> + */ + public long getMinTaskStartTime() { + return minTaskStartTime; + } + + /** * Returns list of all root tasks related to (in other words, started during) * the specified phase task. */ |