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

Tideways with Xhgui #18

Merged
merged 88 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
dad8e64
working in progress
Mte90 Jul 5, 2018
bd116c9
added tideways
Mte90 Jul 5, 2018
49b574b
save also wordpress
Mte90 Jul 5, 2018
27a8f43
improvements
Mte90 Jul 6, 2018
785e39d
improvements
Mte90 Jul 6, 2018
8e819be
better organization
Mte90 Jul 6, 2018
927b146
improve detection of xhgui interfaces
Mte90 Jul 7, 2018
4e88094
fix path
Mte90 Jul 10, 2018
0dad4f8
nginx file
Mte90 Jul 12, 2018
9dc0109
better domain
Mte90 Jul 13, 2018
a38b19d
fix everything
Mte90 Jul 13, 2018
f677ca0
hosts support
Mte90 Jul 13, 2018
44fa3f0
append always hosts
Mte90 Jul 13, 2018
d1e7b30
added hosts
Mte90 Jul 13, 2018
f09ecf2
fix errors
Mte90 Jul 13, 2018
f2b9b46
right filename
Mte90 Jul 13, 2018
e75d1d8
Update provision.sh
Mte90 Jul 18, 2018
a839746
renamed file
Mte90 Jul 18, 2018
a7e1ebc
updates
Mte90 Aug 8, 2018
991ed11
alignment to latest changes on VVV
Mte90 Oct 23, 2018
50f46be
adding vvv-hosts file
Mte90 Oct 24, 2018
35fb48b
move vvv-hosts file
Mte90 Oct 24, 2018
0e1e04d
check if command exist
Mte90 Oct 24, 2018
4e880eb
improving paths
Mte90 Oct 24, 2018
6049a80
silemt output compiler
Mte90 Oct 24, 2018
13031b1
ready for testing
Mte90 Oct 24, 2018
671cb29
updated the domain used
tomjn Jan 14, 2019
8ce2eb5
Update vvv-hosts
tomjn Jan 14, 2019
640f86c
PHP 7.3 tideways support
tomjn Jan 14, 2019
f2885a6
force copy files in case they already exist
tomjn Jan 15, 2019
a334d7d
Fixed the DIR variable, the 0 parameter is always what was being ran,…
tomjn Jan 15, 2019
fb4fd3e
Simplify some parts, fix the detection of PHP versions, and some othe…
tomjn Jan 15, 2019
87f2e1f
removed vvv-hosts
Mte90 Jan 18, 2019
ce8bc8a
local aptkey
Mte90 Jan 18, 2019
2756c3e
local aptkey
Mte90 Jan 18, 2019
28c63e8
revert pwd because dirname is not working
Mte90 Jan 18, 2019
ac3753f
updated path
Mte90 Jan 18, 2019
6b589a0
updated path
Mte90 Jan 18, 2019
5fec39e
get the path
Mte90 Jan 18, 2019
de46e0d
fix the last 2 reported issue
Mte90 Jan 18, 2019
52197b4
bump php version for mongodb
Mte90 Jan 29, 2019
f161a8d
right parameters for ln
Mte90 Jan 29, 2019
2c6b5d3
install for various verison
Mte90 Feb 6, 2019
b7b322f
specify php version for phpenmod
Mte90 Feb 14, 2019
e4663df
specify php version for phpenmod
Mte90 Feb 14, 2019
6ec271d
linting
Mte90 Feb 14, 2019
23232c1
other fixes
Mte90 Feb 14, 2019
949330e
cleaning
Mte90 Feb 14, 2019
b39049e
optimize script
Mte90 Feb 14, 2019
1e51259
symlink to avoid issues with pecl
Mte90 Feb 14, 2019
4ef6575
reorganizing code
Mte90 Feb 14, 2019
7ee18d0
find workaround for pecl
Mte90 Feb 14, 2019
46603db
finally everything works!
Mte90 Feb 14, 2019
ac0b52a
moved mongodb as utility
Mte90 Feb 14, 2019
78389c5
moved mongodb as utility
Mte90 Feb 14, 2019
47b3b13
check if mongo is avalaible
Mte90 Feb 14, 2019
f519faf
missing permission execute to mongodb provision
Mte90 Mar 18, 2019
545b8c8
language and logging improvements
tomjn Mar 18, 2019
3bb58b6
added the xhgui.vvv.test domain to the nginx config
tomjn Mar 18, 2019
e324fea
Abort if mongodb isn't present, always install xhgui, and improve the…
tomjn Mar 18, 2019
7b64547
move the check if mongodb is installed to wrap around the install_mon…
tomjn Mar 19, 2019
43fbc6e
Try to provision mongodb if mongo is unavailable before setting up ti…
tomjn Mar 19, 2019
098b5fe
Unsilence the git clone of xhgui and fix mongodb provisioning
tomjn Mar 19, 2019
2850699
Fix xhgui cloning
tomjn Mar 19, 2019
8d0c471
always provision the xhgui nginx configs
tomjn Mar 19, 2019
0e7258c
remove log output
Mte90 Mar 19, 2019
86ad759
remove log output
Mte90 Mar 19, 2019
c274b12
migrate to package
Mte90 Mar 19, 2019
f4d4fe4
move also the php file
Mte90 Mar 19, 2019
ccf735a
command to load the new php settings
Mte90 Mar 19, 2019
3a7fd4a
fix bash
Mte90 Mar 19, 2019
c462dd6
install mongodb
Mte90 Mar 19, 2019
ab255a9
get right path for mongodb and fix for apt
Mte90 Mar 19, 2019
899ca57
revert back xhprof
Mte90 Mar 19, 2019
f6a2a11
revert also tidewais file
Mte90 Mar 19, 2019
c39800e
fix preped file
Mte90 Mar 19, 2019
083036d
avoid autoscan of xhgui
Mte90 Mar 19, 2019
0a46ed0
add custom files and settings
Mte90 Mar 20, 2019
72e21a8
not compile tideways if there aren't updates
Mte90 Mar 20, 2019
5efe38c
fix path in mongodb to test
Mte90 Mar 23, 2019
b1be987
reset path
Mte90 Mar 23, 2019
83145b4
disable query monitor on loading tideways
Mte90 Mar 26, 2019
b46c7c4
remove the parameter from the url in xhgui
Mte90 Mar 27, 2019
4d6f007
changes how/where/when copying of tideways-header.php happens
tomjn Apr 1, 2019
f60dbb7
only load /srv/www/default/xhgui/external/header.php if it exists
tomjn Apr 1, 2019
46db07f
updates the auto_prepend_file directive
tomjn Apr 1, 2019
c4fa3a9
Improve the mongodb provisioner
tomjn Apr 1, 2019
4d326ad
copy tideways header before handling PHP, and always copy certain fil…
tomjn Apr 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions mongodb/aptkey.pgp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.6
Comment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GDdrT7z/j9iQ7RsnbGBmQlgNBQURXbEm67gUivwZBKRoave2xPb3JX1X
IW/fPQOO5YBK7rMOQsbS8VBj5lXNnWJhyS1JIB7M3XEyx8MvP2q2DHoRu0VcwBBueQLni7HP
QdL0iNBOq5b2pR4KArbQspxMzODpda3BvV7ZQsipOAHopmCxP3MZXJA6CFVcKxV60a4QeNQL
MKz+JeMbZPp1h6Y=
=YmWT
-----END PGP PUBLIC KEY BLOCK-----
1 change: 1 addition & 0 deletions mongodb/mongodb.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension=mongodb.so
45 changes: 45 additions & 0 deletions mongodb/provision.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
# Mongodb
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

install_mongodb_php() {
for version in "7.0" "7.1" "7.2" "7.3"
do
if [[ $(command -v php$version) ]]; then
echo "Installing MongoDB for PHP $version"
sudo pecl -d php_suffix="$version" install mongodb > /dev/null 2>&1
# do not remove files, only register the packages as not installed so we can install for other php version
sudo pecl uninstall -r mongodb > /dev/null 2>&1
cp -f "${DIR}/mongodb.ini" "/etc/php/$version/mods-available/mongodb.ini"
phpenmod -v "$version" mongodb
fi
done
}

install_mongodb() {
echo "Installing MongoDB"
apt-key add "${DIR}/aptkey.pgp"
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt update > /dev/null 2>&1
apt-get -y install mongodb-org re2c
install_mongodb_php
}

cleanup_mongodb_entries() {
echo "Auto-removing mongoDB records older than 2592000 seconds (30 days)"
mongo xhprof --eval 'db.collection.ensureIndex( { "meta.request_ts" : 1 }, { expireAfterSeconds : 2592000 } )' > /dev/null 2>&1
# indexes
mongo xhprof --eval "db.collection.ensureIndex( { 'meta.SERVER.REQUEST_TIME' : -1 } )" > /dev/null 2>&1
mongo xhprof --eval "db.collection.ensureIndex( { 'profile.main().wt' : -1 } )" > /dev/null 2>&1
mongo xhprof --eval "db.collection.ensureIndex( { 'profile.main().mu' : -1 } )" > /dev/null 2>&1
mongo xhprof --eval "db.collection.ensureIndex( { 'profile.main().cpu' : -1 } )" > /dev/null 2>&1
mongo xhprof --eval "db.collection.ensureIndex( { 'meta.url' : 1 } )" > /dev/null 2>&1
}

if [[ ! $(command -v mongo) ]]; then
install_mongodb
fi
cleanup_mongodb_entries

echo "Restarting mongod"
service mongod restart
30 changes: 30 additions & 0 deletions tideways/aptkey.pgp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQENBFPr3H8BCACRvzYJ08kaFPzi3T1+FvjJTz+m7bz0gfEYENI2pfxwTm5utIIC
FGVBVgexoq+oJ5OS2B45BoF9m8zJKfaLBuXxZ05b6wZa9SuTQkj4Hrw0SVMIOb0h
LgCBi2nAhrKS60UrH8kCQ0qza44mCc/KJi97UQM/9EHz9QRhig/+in+h8Q2gUUgq
kqDE48mxhJ77Z6jwSh/QdMthlN990EYgn6Y5eUHkT1tz+TgVhy/Aopje1xGKseet
r5W9G0KDTbHrk976NAz4J6dyxHj/sXifqQwLp/d84EfRKwb+kb3CFDUL62XoMEO3
SoFUB8rkDCMm8nFo/V6mKmDDPdCfPH70Z5D9ABEBAAG0JkJlbmphbWluIEViZXJs
ZWkgPGtvbnRha3RAYmViZXJsZWkuZGU+iQE4BBMBAgAiBQJT69x/AhsDBgsJCAcD
AgYVCAIJCgsEFgIDAQIeAQIXgAAKCRARzYz87rXo9P92B/9M18XHjZWOnKB7VJ9H
YAJM4VijAge07BGskqmkBLDKCing+QtmJu+Nv1ujyVA8UJPLAwB/0Q+xMp/YM8IC
665dgH3VPSFcYUi28u/y+mE5P3sovcRt3wyjgcU1HB04F2XB66N3cd4kQs7nguqd
XfrH5HJ5RKpwrQVZuAqKGBJCsbcCQH3YxMQvQZv5rKtPPV1lUDu8Y11doeaEQNKi
OIO37CvCcFmhv8w0OiRARqm1c4OEmFZ+CH2GPFokWiMmbyHQPJjrDhy7Sdf7b09A
TeLZ6gULU0/ukmLCgRwNu4ocmAJLKAiuzCkTO0mzsI+m+1uRGbmiMqc25zqMchEx
D+z+uQENBFPr3H8BCADazFnvb33ehm4sIyBofyj8uX7fbNyNgFU3opBrjRy6Ixc3
lt+ZKIJgYBb5KVNB/7YuI6txiyYESogopp7pgmzYuf1YnajkA5OjD0nbsgBrnTiu
RG76aLQ6Ukbcju2N5c6yJvrE+KTOqOuVSs1ssG1wJSKp2HkTFYpMshlagoVxUhR7
p7doFqMB54sYHIETWserv2xETpJPq2lEAn7xy8SrqQ7NTLOAyquFIZ85tGb6haBj
0i/cEAvazl0e4VkrTWfcSBFgtvzlDcb/9hxJX5CoPKM0t/RYNncn93T0lBbixunm
eHPCNomwtYssX40xSYASdMROfru1v7ytD/p3edhPABEBAAGJAR8EGAECAAkFAlPr
3H8CGwwACgkQEc2M/O616PSZuQgAjWbfjQOvJnWKvl8uMr3TuW6ERZg460vBuLKM
Ej2BVrtlhKr8IEw1MtkelZWtSCZjrNL8KZxpstcb5m3SWBcTeX55nmm42pnZhS4C
6CZ4Q81U3YvJ3V2qsaAKea/x/pxXOSlvMj/QfM6npMxNJaIAAO4elra4ea+RpW2P
r/1C/Q8kPAS7D6An3QKU0g5s28hOW5Gk3Gv67PzZhyKeb5BTcSwm1Ip6QlnBajOY
jTzH6UjKRDU94pbOMboDC08vIsZMWdOrqAyVN+w3ljNbRtR76rJglwy+UNFHidL7
4kWbuCiIiGciJIV7+Xa1M1b499DQ8TymdKZgjW0Xh7PybfT4vw==
=IiDB
-----END PGP PUBLIC KEY BLOCK-----
40 changes: 40 additions & 0 deletions tideways/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

$defaults = array(
'debug' => false,

// Can be either mongodb or file.
'save.handler' => 'mongodb',

// Needed for file save handler. Beware of file locking. You can adujst this file path
// to reduce locking problems (eg uniqid, time ...)
//'save.handler.filename' => __DIR__.'/../data/xhgui_'.date('Ymd').'.dat',
'db.host' => 'mongodb://127.0.0.1:27017',
'db.db' => 'xhprof',

'templates.path' => dirname(__DIR__) . '/src/templates',
'date.format' => 'M jS H:i:s',
'detail.count' => 6,
'page.limit' => 25,
// Other config
'profiler.enable' => function() {
$url = $_SERVER['REQUEST_URI'];
if (strpos($url, 'vvv.test/') === 0) {
return false;
}
return true;
},
'profiler.replace_url' => function($uri) {
$uri = str_replace('?enable-tideways', '', $uri);
$uri = str_replace('%3Fenable-tideways', '', $uri);
return $uri;
}
);

$custom_args = array();
if( file_exists( './custom-config.php' ) ) {
include_once( './custom-config.php' );
}

// In config/config.php
return array_merge( $defaults, $custom_args );
22 changes: 22 additions & 0 deletions tideways/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
server {
listen 80;
listen 443 ssl;
root /srv/www/default/xhgui/webroot;
index index.php;
server_name tideways.vvv.test xhgui.vvv.test;

gzip off;

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
client_max_body_size 1024M;
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
89 changes: 89 additions & 0 deletions tideways/provision.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env bash
# Tideways with XHgui
DIR=$(dirname "$0")

install_tideways() {
# Tideways is only for php =>7.0
if [[ ! -d /var/local/tideways-php/.git ]]; then
echo "Cloning Tideways extension"
git clone "https://github.com/tideways/php-xhprof-extension" /var/local/tideways-php
else
echo "Updating Tideways extension"
( cd /var/local/tideways-php/ && git pull -q && git checkout -q )
fi
}

install_tideways_php() {
echo "Installing Tideways for PHP $version"
cp -f "${DIR}/tideways-header.php" "/srv/tideways-header.php"
for version in "7.0" "7.1" "7.2" "7.3"
do
if [[ $(command -v php$version) ]]; then
php_modules_path=$(php-config$version --extension-dir)
echo "Copying tideways files for PHP $version"
cp -f "${DIR}/tideways.ini" "/etc/php/$version/mods-available/tideways_xhprof.ini"
cp -f "${DIR}/xhgui-php.ini" "/etc/php/$version/mods-available/xhgui.ini"
if [[ ! -f "$php_modules_path/tideways_xhprof.so" ]] || [[ $(stat -c %Y "$php_modules_path/tideways_xhprof.so") -lt $(stat -c %Y "/var/local/tideways-php/.git/info/") ]]; then
echo "Compiling Tideways for PHP $version"
cp -rf /var/local/tideways-php "/var/local/tideways-php$version"
cd "/var/local/tideways-php${version}"
update-alternatives --set php "/usr/bin/php$version" > /dev/null 2>&1
update-alternatives --set php-config "/usr/bin/php-config$version" > /dev/null 2>&1
update-alternatives --set phpize "/usr/bin/phpize$version" > /dev/null 2>&1
phpize$version > /dev/null 2>&1
./configure --enable-tideways-xhprof --with-php-config=php-config$version > /dev/null 2>&1
make > /dev/null 2>&1
make install > /dev/null 2>&1
rm -rf "/var/local/tideways-php$version"
fi
phpenmod -v "$version" tideways_xhprof
phpenmod -v "$version" xhgui

fi
done
}

restart_php() {
echo "Restarting PHP-FPM server"
for version in "7.0" "7.1" "7.2" "7.3"
do
if [[ $(command -v php$version) ]]; then
service "php$version-fpm" restart > /dev/null 2>&1
fi
done
echo "Restarting Nginx"
service nginx restart > /dev/null 2>&1
}

install_xhgui() {
if [[ ! -d "/srv/www/default/xhgui" ]]; then
echo -e "\nGit cloning xhgui from https://github.com/perftools/xhgui.git"
cd /srv/www/default
git clone "https://github.com/perftools/xhgui.git" xhgui
cd xhgui
echo "Installing xhgui"
sudo php install.php
cp -f "${DIR}/config.php" "/srv/www/default/xhgui/config/config.php"
echo "Restarting MongoDB"
service mongod restart
else
echo -e "\nUpdating xhgui..."
cd /srv/www/default/xhgui
git pull --rebase origin master > /dev/null 2>&1
sudo php install.php > /dev/null 2>&1
fi
}

echo "Installing Tideways & XHgui"
if [[ ! $(command -v mongo) ]]; then
echo "MongoDB is needed for XHGUI/Tideways support, provisioning MongoDB"
. "${DIR}/../mongodb/provision.sh"
fi
DIR=$(dirname "$0")
install_tideways
install_tideways_php
install_xhgui
cp -f "${DIR}/nginx.conf" "/etc/nginx/custom-utilities/xhgui.conf"
restart_php

echo "Tideways and xhgui installed"
13 changes: 13 additions & 0 deletions tideways/tideways-header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

if( isset( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], 'enable-tideways' ) !== false ) {
if ( file_exists( '/srv/www/default/xhgui/external/header.php' ) ) {
include '/srv/www/default/xhgui/external/header.php';
}

define( 'QM_DISABLED', true );
if( file_exists( './custom-header.php' ) ) {
include_once( './custom-header.php' );
}
}

1 change: 1 addition & 0 deletions tideways/tideways.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension=tideways_xhprof.so
1 change: 1 addition & 0 deletions tideways/xhgui-php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto_prepend_file=/srv/tideways-header.php