janakr | ac58ca8 | 2019-02-14 09:34:20 -0800 | [diff] [blame] | 1 | // 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. |
| 14 | package com.google.devtools.build.lib.skyframe; |
| 15 | |
janakr | 4a6f064 | 2019-03-11 14:41:49 -0700 | [diff] [blame] | 16 | import com.google.common.base.Preconditions; |
janakr | ac58ca8 | 2019-02-14 09:34:20 -0800 | [diff] [blame] | 17 | import 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 | */ |
| 23 | public 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; |
janakr | 4a6f064 | 2019-03-11 14:41:49 -0700 | [diff] [blame] | 39 | this.sourceDiffCheckingDuration = Preconditions.checkNotNull(sourceDiffCheckingDuration); |
| 40 | this.outputTreeDiffCheckingDuration = |
| 41 | Preconditions.checkNotNull(outputTreeDiffCheckingDuration); |
janakr | ac58ca8 | 2019-02-14 09:34:20 -0800 | [diff] [blame] | 42 | } |
| 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 | } |