MetricOperationTracer

MetricOperationTracer

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.

Constructor

new MetricOperationTracer()

Members

attemptCount

Returns the number of attempts made for this operation.

currentAttempt

Returns the current MetricAttemptTracer instance for the ongoing attempt.

startTime

Returns the start time of the operation.

Methods

createNewAttempt()

Increments the attempt count and creates a new MetricAttemptTracer for tracking the next attempt within this operation.