Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: future_metrics #19

Merged
merged 8 commits into from
Jun 17, 2024
Merged

feat: future_metrics #19

merged 8 commits into from
Jun 17, 2024

Conversation

xDarksome
Copy link
Member

Description

Adds future_metrics crate providing metrics for futures based on metrics facade.

How Has This Been Tested?

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@xDarksome xDarksome self-assigned this Jun 13, 2024
@xDarksome xDarksome force-pushed the feat/metrics-task-recorder branch from 92f39cb to 99baf63 Compare June 13, 2024 10:38
@xDarksome xDarksome marked this pull request as ready for review June 14, 2024 13:49
@xDarksome xDarksome requested review from nopestack and heilhead June 14, 2024 13:49
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
crates/future_metrics/src/lib.rs Outdated Show resolved Hide resolved
let metadata = Metadata::new(METADATA_TARGET, Level::INFO, None);

Self {
duration: r.register_histogram(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure this references the same counters for all Metrics instances? With opentelemetry we had to use static/shared Counter instances, otherwise the exported data was incorrect.

Copy link
Member Author

Choose a reason for hiding this comment

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

the same function is being called in their macro, so I'm relatively sure

@xDarksome xDarksome requested a review from heilhead June 17, 2024 12:09
@xDarksome
Copy link
Member Author

@heilhead I removed reporting poll_duration on each poll in favor of poll_duration_max being reported in drop.

I think the max is what we really care about.

state.poll_duration_max = state.poll_duration_max.max(poll_duration);
state.polls_count += 1;

if result.is_ready() && !state.is_finished {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't you flip the state.is_finished somewhere in this block?

Copy link
Member Author

Choose a reason for hiding this comment

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

yea, another copy-pasta relic. This code was in drop previously 🤡

although this would only affect fused futures probably

@xDarksome xDarksome merged commit 5d76e0c into main Jun 17, 2024
6 checks passed
@xDarksome xDarksome deleted the feat/metrics-task-recorder branch June 17, 2024 14:08
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.

3 participants