Skip to content

Commit

Permalink
merge batcher views to bigtable client views
Browse files Browse the repository at this point in the history
  • Loading branch information
mutianf committed Aug 24, 2021
1 parent 82c0f09 commit 0117f10
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
Expand Up @@ -193,12 +193,6 @@ public static void enableGfeOpenCensusStats() {
com.google.cloud.bigtable.data.v2.stub.metrics.RpcViews.registerBigtableClientGfeViews();
}

/** Enables OpenCensus metric aggregations for Batch operations. */
@BetaApi("OpenCensus stats integration is currently unstable and may change in the future")
public static void enableOpenCensusBatchStats() {
com.google.cloud.bigtable.data.v2.stub.metrics.RpcViews.registerBigtableClientBatchViews();
}

/** Returns the target project id. */
public String getProjectId() {
return stubSettings.getProjectId();
Expand Down
Expand Up @@ -31,16 +31,14 @@ public class RpcViews {
RpcViewConstants.BIGTABLE_COMPLETED_OP_VIEW,
RpcViewConstants.BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY_VIEW,
RpcViewConstants.BIGTABLE_ATTEMPT_LATENCY_VIEW,
RpcViewConstants.BIGTABLE_ATTEMPTS_PER_OP_VIEW);
RpcViewConstants.BIGTABLE_ATTEMPTS_PER_OP_VIEW,
RpcViewConstants.BIGTABLE_BATCH_THROTTLED_TIME_VIEW);

private static final ImmutableSet<View> GFE_VIEW_SET =
ImmutableSet.of(
RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW,
RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW);

private static final ImmutableSet<View> BIGTABLE_BATCH_VIEWS_SET =
ImmutableSet.of(RpcViewConstants.BIGTABLE_BATCH_THROTTLED_TIME_VIEW);

private static boolean gfeMetricsRegistered = false;

/** Registers all Bigtable specific views. */
Expand All @@ -58,11 +56,6 @@ public static void registerBigtableClientGfeViews() {
registerBigtableClientGfeViews(Stats.getViewManager());
}

/** Register Bigtable batch views. */
public static void registerBigtableClientBatchViews() {
registerBigtableClientBatchViews(Stats.getViewManager());
}

@VisibleForTesting
static void registerBigtableClientViews(ViewManager viewManager) {
for (View view : BIGTABLE_CLIENT_VIEWS_SET) {
Expand All @@ -78,13 +71,6 @@ static void registerBigtableClientGfeViews(ViewManager viewManager) {
gfeMetricsRegistered = true;
}

@VisibleForTesting
static void registerBigtableClientBatchViews(ViewManager viewManager) {
for (View view : BIGTABLE_BATCH_VIEWS_SET) {
viewManager.registerView(view);
}
}

static boolean isGfeMetricsRegistered() {
return gfeMetricsRegistered;
}
Expand Down
Expand Up @@ -109,7 +109,6 @@ public void setUp() throws Exception {
serviceHelper.start();

RpcViews.registerBigtableClientViews(localStats.getViewManager());
RpcViews.registerBigtableClientBatchViews(localStats.getViewManager());

settings =
BigtableDataSettings.newBuilderForEmulator(serviceHelper.getPort())
Expand Down

0 comments on commit 0117f10

Please sign in to comment.