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

Add a ratchet integration #3115

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

Add a ratchet integration #3115

wants to merge 2 commits into from

Conversation

bwoebi
Copy link
Collaborator

@bwoebi bwoebi commented Mar 4, 2025

Implements server (cboden/ratchet) and clients (ratchet/pawl) of ratchet.

This is going to be the basis of further integrations in conjunction with event loops.

@bwoebi bwoebi requested review from a team as code owners March 4, 2025 12:17
@codecov-commenter
Copy link

codecov-commenter commented Mar 4, 2025

Codecov Report

Attention: Patch coverage is 82.89963% with 46 lines in your changes missing coverage. Please review.

Project coverage is 73.20%. Comparing base (b38e9ae) to head (5ded6a4).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...DTrace/Integrations/Ratchet/RatchetIntegration.php 83.20% 45 Missing ⚠️
.../DDTrace/Integrations/Swoole/SwooleIntegration.php 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (82.89%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3115      +/-   ##
============================================
+ Coverage     73.03%   73.20%   +0.17%     
- Complexity     2792     2852      +60     
============================================
  Files           140      141       +1     
  Lines         15372    15640     +268     
  Branches       1067     1067              
============================================
+ Hits          11227    11450     +223     
- Misses         3587     3632      +45     
  Partials        558      558              
Flag Coverage Δ
appsec-extension 68.39% <ø> (ø)
tracer-php 75.03% <82.89%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/ddtrace_php_api.stubs.php 0.00% <ø> (ø)
.../DDTrace/Integrations/Swoole/SwooleIntegration.php 46.92% <0.00%> (ø)
...DTrace/Integrations/Ratchet/RatchetIntegration.php 83.20% <83.20%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b38e9ae...5ded6a4. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter
Copy link

pr-commenter bot commented Mar 4, 2025

Benchmarks [ tracer ]

Benchmark execution time: 2025-03-07 17:47:12

Comparing candidate commit 5ded6a4 in PR branch ratchet-integration with baseline commit b38e9ae in branch master.

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

scenario:TraceSerializationBench/benchSerializeTrace

  • 🟩 execution_time [-25.848µs; -19.952µs] or [-12.636%; -9.754%]

@bwoebi bwoebi force-pushed the ratchet-integration branch from 37fc427 to 7946246 Compare March 4, 2025 13:52
Signed-off-by: Bob Weinand <[email protected]>
Comment on lines 256 to 258
if ($isClose && $message->getOpcode() !== Frame::OP_CLOSE) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you enlighten me on the reason behind this condition? Not saying by any means that it is wrong. Just trying to understand. Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

\DDTrace\install_hook($onControl, $hookFn(true), null, \DDTrace\HOOK_INSTANCE);

This hook - with $isClose === true:
$onControl is called for any control opcode, including pings and pongs for example. We are only interested in close frames.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I probably should rename this to $isControl, then it becomes more obvious.

@bwoebi bwoebi force-pushed the ratchet-integration branch from 7946246 to 5ded6a4 Compare March 7, 2025 17:16
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