Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpClient] Added TraceableHttpClient and WebProfiler panel #33015

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

Merged
merged 1 commit into from
Aug 23, 2019

Conversation

tyx
Copy link
Contributor

@tyx tyx commented Aug 7, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Replace #30494

I added :

  • tests
  • move debug services declaration in dedicated http_client_debug.xml file
  • rename stuff to follow messenger data collector stuff
  • add CompilerPass to allow bundle to trace their own http client

I didn't add all @nicolas-grekas requests on UI profiler. I will continue to make more PR after this one.

IMO everything looks fine to make a first merge except one strange behavior that I am not sure to get :

When making a sub request :

  • we still have the http_client parent data. (like messenger, but currently I did not see anything in code that could avoid that, so different topic I guess).
  • The data collected are already "converted" to VarDumper data, so I have errors when trying to do all the unset stuff in the TraceableHttpClient.

Is it for this reason, some collector use lateCollect ? Should we also move to lateCollect in the HttpClientDataCollector ?

But I'm still new on this subject but glad to help, so feel free to request more changes !

@fabpot
Copy link
Member

fabpot commented Aug 7, 2019

@tyx: Can you please re-add the header information? This is a requirement.

@fabpot
Copy link
Member

fabpot commented Aug 7, 2019

fabbot has some interesting things to say :)

@@ -310,6 +312,10 @@ public function load(array $configs, ContainerBuilder $container)
$container->removeDefinition('console.command.messenger_failed_messages_remove');
}

if ($this->httpClientConfigEnabled = $this->isConfigEnabled($container, $config['http_client'])) {
$this->registerHttpClientConfiguration($config['http_client'], $container, $loader);
}
Copy link
Member

Choose a reason for hiding this comment

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

Can you move it back to the same position it was before? Or is the move important?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is important because profiler should be process after this one to use $this->httpClientConfigEnabled


<services>
<service id="data_collector.http_client" class="Symfony\Component\HttpClient\DataCollector\HttpClientDataCollector">
<tag name="data_collector" template="@WebProfiler/Collector/http_client.html.twig" id="http_client" priority="240" />
Copy link
Member

Choose a reason for hiding this comment

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

is the priority important here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, was already here 😛

@tyx
Copy link
Contributor Author

tyx commented Aug 7, 2019

Many failures on travis seem unrelated : https://travis-ci.org/symfony/symfony/jobs/568907222#L5407

Except one https://travis-ci.org/symfony/symfony/jobs/568907222#L5422 but I guess it's a normal failure as it does not use the right http_client package (The failure is about loading the debug http client stuff in FrameworkBundle without loading the change in http_client)

@nicolas-grekas nicolas-grekas added this to the next milestone Aug 8, 2019
@nicolas-grekas nicolas-grekas force-pushed the traceable-http-client branch 7 times, most recently from 357b689 to a523a5e Compare August 23, 2019 17:09
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(I made some changes and tried the panel locally, failures are false positives.)

Co-authored-by: Jérémy Romey <jeremy@free-agent.fr>
Co-authored-by: Timothée Barray <tim@amicalement-web.net>
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Aug 23, 2019

Thank you @tyx, @IonBazan and @jeremyFreeAgent!

nicolas-grekas added a commit that referenced this pull request Aug 23, 2019
… panel (jeremyFreeAgent)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Added TraceableHttpClient and WebProfiler panel

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Replace #30494

I added :
- tests
- move debug services declaration in dedicated `http_client_debug.xml` file
- rename stuff to follow messenger data collector stuff
- add CompilerPass to allow bundle to trace their own http client

I didn't add all @nicolas-grekas requests on UI profiler. I will continue to make more PR after this one.

IMO everything looks fine to make a first merge except one strange behavior that I am not sure to get :

When making a sub request :
- we still have the http_client parent data. (like messenger, but currently I did not see anything in code that could avoid that, so different topic I guess).
- The data collected are already "converted" to VarDumper data, so I have errors when trying to do all the unset stuff in the TraceableHttpClient.

Is it for this reason, some collector use `lateCollect` ? Should we also move to lateCollect in the `HttpClientDataCollector` ?

But I'm still new on this subject but glad to help, so feel free to request more changes !

Commits
-------

5164001 [HttpClient] Added TraceableHttpClient and WebProfiler panel
@nicolas-grekas nicolas-grekas merged commit 5164001 into symfony:4.4 Aug 23, 2019
@nicolas-grekas
Copy link
Member

See #33311 for possible next steps.

@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.