Skip to content

[PROF-14464] Record the total time spent waiting for the GVL as a metric#5569

Merged
eregon merged 1 commit into
masterfrom
bd/gvl-metrics
May 4, 2026
Merged

[PROF-14464] Record the total time spent waiting for the GVL as a metric#5569
eregon merged 1 commit into
masterfrom
bd/gvl-metrics

Conversation

@eregon

@eregon eregon commented Apr 9, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Record the total time spent waiting for the GVL as a metric.
See #3433.

Motivation:

That issue.

Change log entry

Yes. Added metric for total time spent waiting for the GVL.

Additional Notes:

Yes, I'm experimenting with Cursor.

How to test the change?

@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown

Thank you for updating Change log entry section 👏

Visited at: 2026-04-09 14:13:34 UTC

@github-actions github-actions Bot added the profiling Involves Datadog profiling label Apr 9, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 97.21% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2556ab2 | Docs | Datadog PR Page | Give us feedback!

@eregon
eregon force-pushed the bd/gvl-metrics branch 2 times, most recently from 5aee7cb to 472c7ee Compare April 9, 2026 13:51
@pr-commenter

pr-commenter Bot commented Apr 9, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-04 09:50:38

Comparing candidate commit 2556ab2 in PR branch bd/gvl-metrics with baseline commit bb919c7 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 1 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@ivoanjo ivoanjo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

Comment thread ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c Outdated
@eregon
eregon force-pushed the bd/gvl-metrics branch 3 times, most recently from cc1ffe9 to ca5bd7a Compare April 9, 2026 16:41
Comment thread lib/datadog/profiling/exporter.rb Outdated
Comment thread spec/datadog/profiling/flush_spec.rb Outdated
Comment thread lib/datadog/profiling/flush.rb
@eregon
eregon force-pushed the bd/gvl-metrics branch 3 times, most recently from 767eaab to 3c1bb09 Compare April 29, 2026 10:26
@eregon
eregon marked this pull request as ready for review April 29, 2026 10:27
@eregon
eregon requested review from a team as code owners April 29, 2026 10:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c1bb09e6a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c Outdated
@eregon
eregon force-pushed the bd/gvl-metrics branch 2 times, most recently from e1d7d9a to 49a8c91 Compare April 29, 2026 12:24

@ivoanjo ivoanjo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 LGTM.

From the Ruby side we're in great shape, yet we'll probably want to do one last "test this end-to-end" before merging, just in case we missed some small detail that makes the backend unhappy.

Comment thread lib/datadog/profiling/flush.rb
@eregon
eregon force-pushed the bd/gvl-metrics branch from 062ef17 to 2556ab2 Compare May 4, 2026 09:24
@eregon

eregon commented May 4, 2026

Copy link
Copy Markdown
Member Author

CI was green before rebase, the CI failures are unrelated to this PR and caused by #5656, merging.

@eregon
eregon merged commit b02fa7b into master May 4, 2026
435 of 439 checks passed
@eregon
eregon deleted the bd/gvl-metrics branch May 4, 2026 09:58
@dd-octo-sts dd-octo-sts Bot added this to the 2.32.0 milestone May 4, 2026
@eregon eregon changed the title Record the total time spent waiting for the GVL as a metric [PROF-14464] Record the total time spent waiting for the GVL as a metric May 4, 2026
@eregon eregon mentioned this pull request May 5, 2026
@eregon eregon linked an issue May 5, 2026 that may be closed by this pull request
@marcotc marcotc mentioned this pull request May 7, 2026
eregon added a commit that referenced this pull request May 21, 2026
eregon added a commit that referenced this pull request May 21, 2026
eregon added a commit that referenced this pull request May 26, 2026
eregon added a commit that referenced this pull request May 26, 2026
eregon added a commit that referenced this pull request May 26, 2026
eregon added a commit that referenced this pull request May 27, 2026
eregon added a commit that referenced this pull request May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Involves Datadog profiling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add metrics around GVL

2 participants