diff options
author | 2017-04-24 17:34:20 +0200 | |
---|---|---|
committer | 2017-04-24 18:00:29 +0200 | |
commit | 3d596d63f883fff56001ed7b2e5cf51dba45f082 (patch) | |
tree | c3e488c85eaa26ab83176750727429d325aaa1ef /src/main/java/com/google/devtools/build/lib/buildeventstream/AnnounceBuildEventTransportsEvent.java | |
parent | 29aee67c0c95af2840faa47a071b72adf4b734ce (diff) |
BEP: Show protocol upload in the UI
The BEP (build event protocol) upload may at times take longer than the build
itself. This is especially true for cached builds, where there is little build
work, but the protocol still needs to be uploaded. In this case the bazel UI
will now display that it's waiting for BEP upload, both in the current and the
new experimental UI (--experimental_ui).
When executing a run command, blaze waits for the BEP upload to finish before
it runs the target.
Major Modifications:
- The BuildEventTransport interface now also has a name() method that returns
a string. When waiting for a transport to finish the BEP upload, this string
is displayed in the UI.
- The BuildEventStreamer now emits two new events
AnnounceBuildEventTransportsEvent and BuildEventTransportClosed on the event
bus. This is how the experimental UI is informed about BEP upload progress.
RELNOTES: None
PiperOrigin-RevId: 154052401
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildeventstream/AnnounceBuildEventTransportsEvent.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/buildeventstream/AnnounceBuildEventTransportsEvent.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/AnnounceBuildEventTransportsEvent.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/AnnounceBuildEventTransportsEvent.java new file mode 100644 index 0000000000..e27f0b13ec --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/AnnounceBuildEventTransportsEvent.java @@ -0,0 +1,38 @@ +// Copyright 2017 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.buildeventstream; + +import com.google.common.collect.ImmutableSet; +import com.google.devtools.build.lib.events.ExtendedEventHandler.Postable; +import java.util.Collection; +import java.util.Set; + +/** + * An event announcing a list of all active {@link BuildEventTransport}s. + */ +public class AnnounceBuildEventTransportsEvent implements Postable { + + private final Set<BuildEventTransport> transports; + + public AnnounceBuildEventTransportsEvent(Collection<BuildEventTransport> transports) { + this.transports = ImmutableSet.copyOf(transports); + } + + /** + * Returns a list of all active build event transports. + */ + public Set<BuildEventTransport> transports() { + return transports; + } +} |