Introduce an Extrema aggregator.
RELNOTES: None
PiperOrigin-RevId: 187370833
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Package.java b/src/main/java/com/google/devtools/build/lib/packages/Package.java
index 0430700..7a8b121 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Package.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Package.java
@@ -721,7 +721,7 @@
*/
public static class Builder {
- public static interface Helper {
+ public interface Helper {
/**
* Returns a fresh {@link Package} instance that a {@link Builder} will internally mutate
* during package loading. Called by {@link PackageFactory}.
@@ -730,10 +730,13 @@
/**
* Called after {@link com.google.devtools.build.lib.skyframe.PackageFunction} is completely
- * done loading the given {@link Package}. {@code skylarkSemantics} are the semantics used to
- * evaluate the build.
+ * done loading the given {@link Package}.
+ *
+ * @param pkg the loaded {@link Package}
+ * @param skylarkSemantics are the semantics used to load the package
+ * @param loadTimeMs the wall time, in ms, that it took to load the package
*/
- void onLoadingComplete(Package pkg, SkylarkSemantics skylarkSemantics);
+ void onLoadingComplete(Package pkg, SkylarkSemantics skylarkSemantics, long loadTimeMs);
}
/** {@link Helper} that simply calls the {@link Package} constructor. */
@@ -749,7 +752,8 @@
}
@Override
- public void onLoadingComplete(Package pkg, SkylarkSemantics skylarkSemantics) {
+ public void onLoadingComplete(
+ Package pkg, SkylarkSemantics skylarkSemantics, long loadTimeMs) {
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java b/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java
index daf3dfe..3f3ad09 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java
@@ -390,7 +390,7 @@
* Constructs a {@code PackageFactory} instance with a specific glob path translator
* and rule factory.
*
- * <p>Only intended to be called by BlazeRuntime or {@link FactoryForTesting#create}.
+ * <p>Only intended to be called by BlazeRuntime or {@link BuilderForTesting#build}.
*
* <p>Do not call this constructor directly in tests; please use
* TestConstants#PACKAGE_FACTORY_BUILDER_FACTORY_FOR_TESTING instead.
@@ -1617,8 +1617,9 @@
* Called by a caller of {@link #createPackageFromAst} after this caller has fully
* loaded the package.
*/
- public void afterDoneLoadingPackage(Package pkg, SkylarkSemantics skylarkSemantics) {
- packageBuilderHelper.onLoadingComplete(pkg, skylarkSemantics);
+ public void afterDoneLoadingPackage(
+ Package pkg, SkylarkSemantics skylarkSemantics, long loadTimeNanos) {
+ packageBuilderHelper.onLoadingComplete(pkg, skylarkSemantics, loadTimeNanos);
}
/**