Class BaseApiTracer (2.49.0)

public class BaseApiTracer implements ApiTracer

A base implementation of ApiTracer that does nothing. With the deprecation of Java 7 support, all the methods in ApiTracer are now made default, we no longer need a base class that does nothing. This class should be removed once all the references to it are removed in Google Cloud Client Libraries.

For internal use only.

Inheritance

Object > BaseApiTracer

Implements

ApiTracer

Static Methods

getInstance()

public static ApiTracer getInstance()
Returns
Type Description
ApiTracer

Constructors

BaseApiTracer()

protected BaseApiTracer()

Methods

attemptCancelled()

public void attemptCancelled()

Add an annotation that the attempt was cancelled by the user.

attemptFailed(Throwable error, Duration delay)

public void attemptFailed(Throwable error, Duration delay)

Adds an annotation that the attempt failed, but another attempt will be made after the delay.

Parameters
Name Description
error Throwable
delay org.threeten.bp.Duration

attemptFailedRetriesExhausted(Throwable error)

public void attemptFailedRetriesExhausted(Throwable error)

Adds an annotation that the attempt failed and that no further attempts will be made because retry limits have been reached.

Parameter
Name Description
error Throwable

attemptPermanentFailure(Throwable error)

public void attemptPermanentFailure(Throwable error)

Adds an annotation that the attempt failed and that no further attempts will be made because the last error was not retryable.

Parameter
Name Description
error Throwable

attemptStarted(int attemptNumber)

public void attemptStarted(int attemptNumber)

Adds an annotation that an attempt is about to start. In general this should occur at the very start of the operation. The attemptNumber is zero based. So the initial attempt will be 0.

Parameter
Name Description
attemptNumber int

attemptStarted(Object request, int attemptNumber)

public void attemptStarted(Object request, int attemptNumber)

Adds an annotation that an attempt is about to start with additional information from the request. In general this should occur at the very start of the operation. The attemptNumber is zero based. So the initial attempt will be 0.

Parameters
Name Description
request Object
attemptNumber int

attemptSucceeded()

public void attemptSucceeded()

Adds an annotation that the attempt succeeded.

batchRequestSent(long elementCount, long requestSize)

public void batchRequestSent(long elementCount, long requestSize)

Adds an annotation that a batch of writes has been flushed.

Parameters
Name Description
elementCount long
requestSize long

connectionSelected(String id)

public void connectionSelected(String id)

Annotates the operation with selected connection id from the ChannelPool.

Parameter
Name Description
id String

inScope()

public ApiTracer.Scope inScope()

Asks the underlying implementation to install itself as a thread local. This allows for interop between clients using gax and external resources to share the same implementation of the tracing. For example OpenCensus will install a thread local that can read by the GRPC.

Returns
Type Description
ApiTracer.Scope

lroStartFailed(Throwable error)

public void lroStartFailed(Throwable error)

Signals that the initial RPC for the long running operation failed.

Parameter
Name Description
error Throwable

lroStartSucceeded()

public void lroStartSucceeded()

Signals that the initial RPC successfully started the long running operation. The long running operation will now be polled for completion.

operationCancelled()

public void operationCancelled()

Signals that the operation was cancelled by the user. The tracer is now considered closed and should no longer be used.

operationFailed(Throwable error)

public void operationFailed(Throwable error)

Signals that the overall operation has failed and no further attempts will be made. The tracer is now considered closed and should no longer be used.

Parameter
Name Description
error Throwable

operationSucceeded()

public void operationSucceeded()

Signals that the overall operation has finished successfully. The tracer is now considered closed and should no longer be used.

requestSent()

public void requestSent()

Adds an annotation that a streaming request has been sent.

responseReceived()

public void responseReceived()

Adds an annotation that a streaming response has been received.