-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ring/ring.go: update metrics on ring changes and not periodically
When writing e2e tests for services using Ring, it is natural to wait for having all tokens assigned. With the default 10s interval for updating metrics, this slows down tests considerably. This was not the case before PR 50 where metrics were collected on request. This commit moves updateMetrics into updateRingState, but also optimizes away updates to ring token ownership metrics when only state or timestamps have changed and skips the metrics entirely when nothing changed. The reasoning is that changes to the ring tokens are infrequent so we can afford a relatively heavy operation. Signed-off-by: György Krajcsovits <[email protected]>
- Loading branch information
Showing
2 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters