Skip to content

Commit

Permalink
restore metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp committed Dec 11, 2024
1 parent d13c96b commit 540b19d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.google.cloud.bigtable.data.v2.stub.metrics;

import static com.google.api.gax.tracing.ApiTracerFactory.OperationType;
import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration;
import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_NAME_KEY;
import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLUSTER_ID_KEY;
import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.METHOD_KEY;
Expand All @@ -24,6 +25,7 @@
import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.TABLE_ID_KEY;
import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.ZONE_ID_KEY;

import com.google.api.core.ObsoleteApi;
import com.google.api.gax.retrying.ServerStreamingAttemptException;
import com.google.api.gax.tracing.SpanName;
import com.google.cloud.bigtable.Version;
Expand Down Expand Up @@ -200,6 +202,16 @@ public void attemptCancelled() {
recordAttemptCompletion(new CancellationException());
}

/**
* This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)}
* instead.
*/
@ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead")
@Override
public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) {
attemptFailedDuration(error, toJavaTimeDuration(delay));
}

@Override
public void attemptFailedDuration(Throwable error, Duration delay) {
recordAttemptCompletion(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/
package com.google.cloud.bigtable.data.v2.stub.metrics;

import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration;

import com.google.api.core.ObsoleteApi;
import com.google.api.gax.tracing.ApiTracer;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
Expand Down Expand Up @@ -123,6 +126,16 @@ public void attemptCancelled() {
}
}

/**
* This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)}
* instead.
*/
@ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead")
@Override
public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) {
attemptFailedDuration(error, toJavaTimeDuration(delay));
}

@Override
public void attemptFailedDuration(Throwable error, java.time.Duration delay) {
for (ApiTracer child : children) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/
package com.google.cloud.bigtable.data.v2.stub.metrics;

import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration;

import com.google.api.core.ObsoleteApi;
import com.google.api.gax.retrying.ServerStreamingAttemptException;
import com.google.api.gax.tracing.ApiTracerFactory.OperationType;
import com.google.api.gax.tracing.SpanName;
Expand Down Expand Up @@ -151,6 +154,16 @@ public void attemptCancelled() {
recordAttemptCompletion(new CancellationException());
}

/**
* This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)}
* instead.
*/
@ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead")
@Override
public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) {
attemptFailedDuration(error, toJavaTimeDuration(delay));
}

@Override
public void attemptFailedDuration(Throwable throwable, java.time.Duration duration) {
recordAttemptCompletion(throwable);
Expand Down

0 comments on commit 540b19d

Please sign in to comment.