Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #38
When the Symfony profiler is enabled, the bundle now adds an "Elastically" panel and a web debug toolbar item.
For each connection, the panel lists the requests sent to Elasticsearch with:
HEADanswered by a 404, likeIndex::exists(), is not counted as an error);The stopwatch is also fed, so the requests show up in the Performance panel.
Screenshots:
The web debug toolbar:
The panel, with a duplicated request and an error:
The request body and the response of a search:
How it works:
TraceableClientextendsClientand records each request insendRequest(), which has the same signature with Elastica 8 and 9.DataCollectorPassdoes nothing unless theprofilerservice exists. Otherwise it swaps the class of every connection client toTraceableClientand registers theElasticallyDataCollector. Nothing to configure, and no change when the profiler is disabled (prod).Not done here, but could come later: "explain" / "profile" / "replay" buttons.
symfony/twig-bundle,symfony/web-profiler-bundleandsymfony/css-selectorare added torequire-devfor the functional test, which renders the panel.