Skip to content

Commit dca3a2b

Browse files
committed
Add javadoc for DrainingBuildListener.
1 parent 9f07c1f commit dca3a2b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/metrics/DrainingBuildListener.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@
1818
import org.gradle.BuildResult;
1919
import org.gradle.api.logging.Logger;
2020

21+
/**
22+
* Build listener that waits for Stackdriver to export metrics before exiting.
23+
*
24+
* <p>Stackdriver exporter is implemented in such a way that it exports metrics on a periodic basis,
25+
* with period being configurable. This means that, when the build finishes and exits, it is highly
26+
* likely that there are unexported metrics in memory. For this reason we have this build listener
27+
* that makes the gradle process sleep for the duration of the configured export period to make sure
28+
* metrics get exported.
29+
*
30+
* @see <a
31+
* href="https://opencensus.io/exporters/supported-exporters/java/stackdriver-stats/">Opencensus
32+
* docs</a>
33+
*/
2134
class DrainingBuildListener extends BuildAdapter {
2235
private final long sleepDuration;
2336
private final Logger logger;

0 commit comments

Comments
 (0)