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

tracing-subscriber: count numbers of enters in Timings #2944

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mladedav
Copy link
Contributor

Motivation

The timings measurements were done naively in a way where they added busy time in on_exit and idle time in `on_enter. This works only if the spans are not entered multiple times. For example if a span is:

entered
wait 1 second
entered
exited
exited

The timing would be about 1 second of idle time and no busy time.

Solution

Count the relative number of enters and exits and only increment the timers on top-level enters and exits.

@mladedav mladedav requested review from hawkw, davidbarsky and a team as code owners April 20, 2024 19:35
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

yup, this is what we do in tokio-console, so it makes sense to do it here as well! thanks!

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.

None yet

2 participants