Skip to content

Commit e2e663a

Browse files
committed
address comment
1 parent 1fef2a1 commit e2e663a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableCloudMonitoringExporter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.io.IOException;
3838
import java.util.Collection;
3939
import java.util.List;
40+
import java.util.concurrent.TimeUnit;
4041
import java.util.concurrent.atomic.AtomicBoolean;
4142
import java.util.logging.Level;
4243
import java.util.logging.Logger;
@@ -154,6 +155,11 @@ public CompletableResultCode shutdown() {
154155
return CompletableResultCode.ofSuccess();
155156
}
156157
CompletableResultCode resultCode = 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+
}
157163
try {
158164
client.shutdown();
159165
} catch (Throwable e) {
@@ -164,7 +170,7 @@ public CompletableResultCode shutdown() {
164170
}
165171

166172
/**
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
168174
* over time.
169175
*/
170176
@Override
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.google.cloud.bigtable.data.v2.stub.metrics;
2+
3+
4+
public class Test {
5+
6+
public static void main(String[] args) {}
7+
}

0 commit comments

Comments
 (0)