blob: 2853756a0678086b2ef281e2f38c8b99b42ec94e [file] [log] [blame]
janakrac58ca82019-02-14 09:34:20 -08001// Copyright 2014 The Bazel Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14package com.google.devtools.build.lib.skyframe;
15
janakr4a6f0642019-03-11 14:41:49 -070016import com.google.common.base.Preconditions;
janakrac58ca82019-02-14 09:34:20 -080017import java.time.Duration;
18
19/**
20 * Event signaling the end of the execution phase. Contains statistics about the action cache,
21 * the metadata cache and about last file save times.
22 */
23public class ExecutionFinishedEvent {
24 public static final ExecutionFinishedEvent EMPTY =
25 new ExecutionFinishedEvent(0, 0, Duration.ZERO, Duration.ZERO);
26
27 private final int outputDirtyFiles;
28 private final int outputModifiedFilesDuringPreviousBuild;
29 private final Duration sourceDiffCheckingDuration;
30 private final Duration outputTreeDiffCheckingDuration;
31
32 ExecutionFinishedEvent(
33 int outputDirtyFiles,
34 int outputModifiedFilesDuringPreviousBuild,
35 Duration sourceDiffCheckingDuration,
36 Duration outputTreeDiffCheckingDuration) {
37 this.outputDirtyFiles = outputDirtyFiles;
38 this.outputModifiedFilesDuringPreviousBuild = outputModifiedFilesDuringPreviousBuild;
janakr4a6f0642019-03-11 14:41:49 -070039 this.sourceDiffCheckingDuration = Preconditions.checkNotNull(sourceDiffCheckingDuration);
40 this.outputTreeDiffCheckingDuration =
41 Preconditions.checkNotNull(outputTreeDiffCheckingDuration);
janakrac58ca82019-02-14 09:34:20 -080042 }
43
44 public int getOutputDirtyFiles() {
45 return outputDirtyFiles;
46 }
47
48 public int getOutputModifiedFilesDuringPreviousBuild() {
49 return outputModifiedFilesDuringPreviousBuild;
50 }
51
52 public Duration getSourceDiffCheckingDuration() {
53 return sourceDiffCheckingDuration;
54 }
55
56 public Duration getOutputTreeDiffCheckingDuration() {
57 return outputTreeDiffCheckingDuration;
58 }
59}