-
-
Notifications
You must be signed in to change notification settings - Fork 579
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
Improve xhprof availability and revert to just using the classic run list page #3087
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
087d737
Remove usage of xhprof_append.php, unneeded
rfay fcfab24
Starting to work
rfay 941101e
Now not doing xhprof on xhprof pages
rfay 85b144e
May also now be working with js override
rfay 98f2cf6
Improve prepend
rfay 4765fdf
Improve the xhprof.conf so it doesn't redirect wrong
rfay 68239ff
Improve prepend so doesn't do its work on command line
rfay 5b01f79
Forgot script type in prepend
rfay 47d405e
Stop trying to output a link on the page itself; breaks all api calls…
rfay f00a97b
Update docs to new technique of having to hit another url
rfay d4f5c2d
Minor addition to docs
rfay e1e71e7
Go back to just using the traditional xhprof page
rfay File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
3 changes: 2 additions & 1 deletion
3
containers/ddev-webserver/ddev-webserver-base-files/etc/nginx/common.d/xhprof.conf
This file contains 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
1 change: 0 additions & 1 deletion
1
containers/ddev-webserver/ddev-webserver-base-files/etc/php/5.6/mods-available/xhprof.ini
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
extension=xhprof.so | ||
xhprof.output_dir=/tmp/xhprof | ||
auto_prepend_file=/usr/local/bin/xhprof_prepend.php | ||
auto_append_file=/usr/local/bin/xhprof_append.php |
1 change: 0 additions & 1 deletion
1
containers/ddev-webserver/ddev-webserver-base-files/etc/php/7.0/mods-available/xhprof.ini
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
extension=xhprof.so | ||
xhprof.output_dir=/tmp/xhprof | ||
auto_prepend_file=/usr/local/bin/xhprof_prepend.php | ||
auto_append_file=/usr/local/bin/xhprof_append.php |
1 change: 0 additions & 1 deletion
1
containers/ddev-webserver/ddev-webserver-base-files/etc/php/7.1/mods-available/xhprof.ini
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
extension=xhprof.so | ||
xhprof.output_dir=/tmp/xhprof | ||
auto_prepend_file=/usr/local/bin/xhprof_prepend.php | ||
auto_append_file=/usr/local/bin/xhprof_append.php |
1 change: 0 additions & 1 deletion
1
containers/ddev-webserver/ddev-webserver-base-files/etc/php/7.2/mods-available/xhprof.ini
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
extension=xhprof.so | ||
xhprof.output_dir=/tmp/xhprof | ||
auto_prepend_file=/usr/local/bin/xhprof_prepend.php | ||
auto_append_file=/usr/local/bin/xhprof_append.php |
1 change: 0 additions & 1 deletion
1
containers/ddev-webserver/ddev-webserver-base-files/etc/php/7.3/mods-available/xhprof.ini
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
extension=xhprof.so | ||
xhprof.output_dir=/tmp/xhprof | ||
auto_prepend_file=/usr/local/bin/xhprof_prepend.php | ||
auto_append_file=/usr/local/bin/xhprof_append.php |
1 change: 0 additions & 1 deletion
1
containers/ddev-webserver/ddev-webserver-base-files/etc/php/7.4/mods-available/xhprof.ini
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
extension=xhprof.so | ||
xhprof.output_dir=/tmp/xhprof | ||
auto_prepend_file=/usr/local/bin/xhprof_prepend.php | ||
auto_append_file=/usr/local/bin/xhprof_append.php |
1 change: 0 additions & 1 deletion
1
containers/ddev-webserver/ddev-webserver-base-files/etc/php/8.0/mods-available/xhprof.ini
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
extension=xhprof.so | ||
xhprof.output_dir=/tmp/xhprof | ||
auto_prepend_file=/usr/local/bin/xhprof_prepend.php | ||
auto_append_file=/usr/local/bin/xhprof_append.php |
This file contains 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
16 changes: 0 additions & 16 deletions
16
containers/ddev-webserver/ddev-webserver-base-files/usr/local/bin/xhprof_append.php
This file was deleted.
Oops, something went wrong.
23 changes: 22 additions & 1 deletion
23
containers/ddev-webserver/ddev-webserver-base-files/usr/local/bin/xhprof_prepend.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
<?php | ||
if (extension_loaded('xhprof')) { | ||
|
||
$uri = "none"; | ||
if (!empty($_SERVER) && array_key_exists('REQUEST_URI', $_SERVER)) { | ||
$uri = $_SERVER['REQUEST_URI']; | ||
} | ||
|
||
// Enable xhprof profiling if we're not on an xhprof page | ||
if (extension_loaded('xhprof') && strpos($uri, '/xhprof') === false) { | ||
xhprof_enable(); | ||
register_shutdown_function('xhprof_completion'); | ||
} | ||
|
||
// Write to the xhprof_html output and latest on completion | ||
function xhprof_completion() { | ||
$xhprof_link_dir = "/var/www/xhprof/xhprof_html/latest/"; | ||
|
||
$xhprof_data = xhprof_disable(); | ||
$appNamespace = "ddev"; | ||
include_once '/var/www/xhprof/xhprof_lib/utils/xhprof_lib.php'; | ||
include_once '/var/www/xhprof/xhprof_lib/utils/xhprof_runs.php'; | ||
|
||
$xhprof_runs = new XHProfRuns_Default(); | ||
$run_id = $xhprof_runs->save_run($xhprof_data, $appNamespace); | ||
} |
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we want the ability for a dev user to supply their own script here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been thinking about that, and definitely agree. Can go so very far into the weeds. I've also thought about having the script optionally add the link at the bottom. But mucking with the output breaks all APIs and all command-line scripts and lots of web pages (like TYPO3).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be cool to have the shutdown function include a file which was easily editable by the user, perhaps empty by default.