MetricOperationTracer tracks the lifecycle and metadata of a single gRPC spanner operation,
which may consist of multiple attempts.
This class is responsible for:
- Recording the start time of the operation.
- Tracking the number of attempts made for the operation.
- Holding a reference to the current attempt's tracer (MetricAttemptTracer).
- Storing the final status code of the operation.
Usage:
- Call
start() to reset the operation's start time.
- Call
createNewAttempt() to begin tracking a new attempt within the operation.
- Access
currentAttempt to retrieve the current MetricAttemptTracer instance.
- Access
attemptCount to get the number of attempts made so far.
- Access
startTime to get the operation's start time.
- Set or read
status to track the operation's final status code.