Skip to content

Conversation

@Centril
Copy link
Contributor

@Centril Centril commented May 14, 2025

Description of Changes

Two things happen here that work together to improve performance:

  • Calls to with_label_values are cached to the extent possible.
  • No metrics are reported while a transaction lock, read-only or mutable, is held.

Changes to traits.rs are:

  • Transaction terminal functions (methods consuming transactions, like committing) now also return TxMetrics and sometimes also the reducer name (String) from the ExecutionContext.
  • TxData now exposes which tables were affected.

Closes #1099 which was the first attempt at not reporting while holding the lock. The PR has since bitrotted.

API and ABI breaking changes

None

Expected complexity level and risk

3, most of the complication is where datastore transactionality is touched.

Testing

Should be covered by existing tests.

@Centril Centril requested a review from cloutiertyler as a code owner May 14, 2025 11:26
@Centril Centril requested a review from joshua-spacetime May 14, 2025 11:27
@Centril Centril changed the title Cache with_label_values where possible & don't do metrics while holding lock Cache with_label_values more & don't do metrics while holding lock May 14, 2025
@Centril Centril force-pushed the centril/smarter-metrics branch from 17ec5d4 to 82f9ff5 Compare May 19, 2025 17:25
@Centril Centril requested a review from gefjon May 19, 2025 17:26
@bfops bfops added the release-any To be landed in any release window label May 20, 2025
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with comments.

@Centril Centril force-pushed the centril/smarter-metrics branch from 864ab59 to 87d0a73 Compare May 21, 2025 13:33
@Centril Centril enabled auto-merge May 21, 2025 13:33
@Centril Centril force-pushed the centril/smarter-metrics branch from 6b90c08 to 9df55dd Compare May 21, 2025 13:39
@Centril Centril disabled auto-merge May 21, 2025 13:39
@Centril Centril enabled auto-merge May 21, 2025 13:39
@Centril Centril disabled auto-merge May 21, 2025 13:45
@Centril Centril force-pushed the centril/smarter-metrics branch from 9df55dd to b307d8c Compare May 21, 2025 13:46
@Centril Centril enabled auto-merge May 21, 2025 13:46
@Centril Centril added this pull request to the merge queue May 21, 2025
Merged via the queue into master with commit 05e171c May 21, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants