Skip to content

feat(metrics): Add and use timer guard#491

Open
lcian wants to merge 9 commits into
lcian/feat/proper-metricsfrom
lcian/feat/timer-guard
Open

feat(metrics): Add and use timer guard#491
lcian wants to merge 9 commits into
lcian/feat/proper-metricsfrom
lcian/feat/timer-guard

Conversation

@lcian
Copy link
Copy Markdown
Member

@lcian lcian commented Jun 5, 2026

⚠️ Stacked on #485

Addresses the issues flagged in #485 by introducing objectstore_metrics::timer! that returns a TimerGuard which records elapsed time on drop or explicit consumption with record(). See code for API and more info.

Also updates all the existing usages of timing metrics to use of this new API.

Close FS-375

@lcian lcian changed the base branch from main to lcian/feat/proper-metrics June 5, 2026 12:43
@lcian lcian changed the title feat(service): Add metrics for multipart upload operations in tiered … feat(metrics+server): Add and use timer guard Jun 5, 2026
@codecov

This comment has been minimized.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 5, 2026

FS-375

@lcian lcian changed the title feat(metrics+server): Add and use timer guard feat(metrics): Add and use timer guard Jun 5, 2026

/// Changes the behavior of this guard to always record the metric
/// with `success:true`, even on drop.
pub fn success(mut self) -> Self {
Copy link
Copy Markdown
Member Author

@lcian lcian Jun 5, 2026

Choose a reason for hiding this comment

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

We don't need this atm but I can see some cases where this would realistically be useful, e.g. on an idempotent function that shortcircuits as an optimization.

@lcian

This comment has been minimized.

@lcian

This comment has been minimized.

cursor[bot]

This comment was marked as outdated.

@lcian lcian marked this pull request as ready for review June 5, 2026 13:44
@lcian lcian requested a review from a team as a code owner June 5, 2026 13:44
@lcian lcian requested a review from matt-codecov June 5, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant