Package com.google.cloud.spanner.spi.v1
Interface LatencyTracker
- All Known Implementing Classes:
EwmaLatencyTracker
Interface for tracking latency scores of Spanner servers.
Implementations must be thread-safe as instances may be shared across multiple concurrent operations.
-
Method Summary
Modifier and TypeMethodDescriptiondoublegetScore()Returns the current latency score.voidrecordError(Duration penalty) Records an error and applies a latency penalty.voidUpdates the latency score with a new observation.
-
Method Details
-
getScore
double getScore()Returns the current latency score.- Returns:
- the latency score, where lower is better.
-
update
Updates the latency score with a new observation.- Parameters:
latency- the observed latency.
-
recordError
Records an error and applies a latency penalty.- Parameters:
penalty- the penalty to apply.
-