You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableCloudMonitoringExporter.java
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@
37
37
importjava.io.IOException;
38
38
importjava.util.Collection;
39
39
importjava.util.List;
40
+
importjava.util.concurrent.TimeUnit;
40
41
importjava.util.concurrent.atomic.AtomicBoolean;
41
42
importjava.util.logging.Level;
42
43
importjava.util.logging.Logger;
@@ -154,6 +155,11 @@ public CompletableResultCode shutdown() {
154
155
returnCompletableResultCode.ofSuccess();
155
156
}
156
157
CompletableResultCoderesultCode = flush();
158
+
// wait 1 minute for flush
159
+
resultCode.join(1, TimeUnit.MINUTES);
160
+
if (!resultCode.isSuccess()) {
161
+
logger.log(Level.WARNING, "Timed out waiting for exporter flush.");
162
+
}
157
163
try {
158
164
client.shutdown();
159
165
} catch (Throwablee) {
@@ -164,7 +170,7 @@ public CompletableResultCode shutdown() {
164
170
}
165
171
166
172
/**
167
-
* For cloud monarch always return CUMULATIVE to keep track of the cumulative value of a metric
173
+
* For cloud monitoring always return CUMULATIVE to keep track of the cumulative value of a metric
0 commit comments