Skip to content

minor profiler updates #201

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 2 commits into from
Aug 28, 2017
Merged

minor profiler updates #201

merged 2 commits into from
Aug 28, 2017

Conversation

fbourigault
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets partially #109
Documentation n/a
License MIT

This is part of #109 and solve some edge cases when displaying the profiler panel:

  • don't display empty client tabs in profiler. This happen when the discovery is only used by a third party library.
  • return only collector root stacks. This improve template readability.
  • better count of client messages. When discovery is forced to a configured client, the message count in the client tab is wrong. This introduce a different way to count messages starting by root stacks and going down to nested requests.

    - don't display empty client tabs in profiler.
    - return only collector root stacks.
    - better count of client messages.
@fbourigault fbourigault added this to the 1.8.0 milestone Aug 22, 2017
@fbourigault fbourigault mentioned this pull request Aug 22, 2017
5 tasks
Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

looks sane to me. i wonder about renaming the public method however - if somebody customized the template, things will break for them. could we add a BC method for that with a deprecation? (i know the class is marked as internal, still adjusting the template is a possibility). i am fine if the BC method just returns the root stacks, just so we don't break customized templates.

@fbourigault
Copy link
Contributor Author

I re-added getClientStacks with a deprecation notice.

Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

looks good to me.

CHANGELOG.md Outdated

### Changed

- The `Http\HttplugBundle\Collector\Collector::getClientStack` method returns only stacks without parent.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Stack or Stacks in the method name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stacks!

CHANGELOG.md Outdated

### Deprecated

- The `Http\HttplugBundle\Collector\Collector` `getClientStacks` method is deprecated. Use `getClientRootStacks` method instead.
Copy link
Member

Choose a reason for hiding this comment

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

Http\HttplugBundle\Collector\Collector::getClientStacks

Copy link
Member

Choose a reason for hiding this comment

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

Should we really deprecate the method AND change its behaviour? If fine with deprecate it and leave its current behaviour.

@Nyholm
Copy link
Member

Nyholm commented Aug 24, 2017

Oh, my comments disappeared but are still valid: #201 (comment)

@fbourigault
Copy link
Contributor Author

As the class is internal I decided to keep the method as a proxy. Maybe I should not document the behavior change. Behavior changed for getClients but its not documented. WDYT?

@dbu
Copy link
Collaborator

dbu commented Aug 24, 2017

actually if we leave a BC method, we can just as well leave it unchanged in behaviour. might be the easiest.

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Just some minor changes needed. Also when you update this PR, remember to update the change log.

@@ -131,9 +131,13 @@ public function getFailedStacks()
*/
public function getClients()
{
$stacks = array_filter($this->data['stacks'], function (Stack $stack) {
return $stack->getParent() == null;
Copy link
Member

Choose a reason for hiding this comment

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

Should be ===

@@ -143,12 +147,52 @@ public function getClients()
*/
public function getClientStacks($client)
{
@trigger_error(sprintf('Method %s() is deprecated since version 1.8 and will be removed in 2.0. Use getClientRootStacks() instead.', __METHOD__), E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

Remove this method completely or leave it unchanged (and deprecate it). It is fine to remove it since the Collector class is @internal.

@dbu
Copy link
Collaborator

dbu commented Aug 28, 2017

on the BC topic: my point was that even though the class is marked as internal, its used in the template so it might be customized. but i agree, lets drop the method. at worst, somebody gets an exception in their customized toolbar template. lets just do an entry in the changelog that the method has been renamed and only returns root stacks now.

@fbourigault
Copy link
Contributor Author

Do we really need to clutter the changelog with internal changes?

@dbu
Copy link
Collaborator

dbu commented Aug 28, 2017

the one person having a problem would probably open an issue here if they don't find what happened, so i'd say i am fine without a changelog entry.

CHANGELOG.md Outdated
### Changed

- The `Http\HttplugBundle\Collector\Collector` `getClientStacks` method have been renamed to `getClientRootStacks`
and now returns only stacks without any parent.
Copy link
Collaborator

@dbu dbu Aug 28, 2017

Choose a reason for hiding this comment

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

i am fine to remove this changelog entry if you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, I didn't saw the without in you previous comment!

@Nyholm Nyholm merged commit 1627ff4 into php-http:master Aug 28, 2017
@fbourigault fbourigault deleted the minor-profiler-updates branch August 28, 2017 09:55
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