File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/metrics Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 18
18
import org .gradle .BuildResult ;
19
19
import org .gradle .api .logging .Logger ;
20
20
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
+ */
21
34
class DrainingBuildListener extends BuildAdapter {
22
35
private final long sleepDuration ;
23
36
private final Logger logger ;
You can’t perform that action at this time.
0 commit comments