XHProf setup

This commit is contained in:
Eldad Fux 2020-05-14 08:42:13 +03:00
parent 9e6553028f
commit dc0ba2641f
2 changed files with 22 additions and 0 deletions

View file

@ -22,6 +22,15 @@ RUN \
phpize$PHP_VERSION && \
./configure && \
make && \
# # XHprof Extension
# git clone "https://github.com/tideways/php-xhprof-extension.git" && \
# cd php-xhprof-extension && \
# phpize$PHP_VERSION && \
# ./configure && \
# make && \
# make install && \
# ls -ll && \
# ls -ll modules && \
# Composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
@ -73,6 +82,7 @@ ENV TZ=Asia/Tel_Aviv \
#ENV _APP_SMTP_PASSWORD ''
COPY --from=builder /phpredis-5.2.1/modules/redis.so /usr/lib/php/20190902/
#COPY --from=builder /phpredis-5.2.1/php-xhprof-extension/modules/tideways_xhprof.so /usr/lib/php/20190902/
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
@ -94,6 +104,9 @@ RUN \
# Redis Extension
echo extension=redis.so >> /etc/php/$PHP_VERSION/fpm/conf.d/redis.ini && \
echo extension=redis.so >> /etc/php/$PHP_VERSION/cli/conf.d/redis.ini && \
# XHProf Extension
#echo extension=tideways_xhprof.so >> /etc/php/$PHP_VERSION/fpm/conf.d/xhprof.ini && \
#echo extension=tideways_xhprof.so >> /etc/php/$PHP_VERSION/cli/conf.d/xhprof.ini && \
# Cleanup
cd ../ && \
apt-get purge -y --auto-remove software-properties-common gnupg curl && \

View file

@ -8,6 +8,8 @@
* Rick Cook, The Wizardry Compiled
*/
// tideways_xhprof_enable(TIDEWAYS_XHPROF_FLAGS_MEMORY | TIDEWAYS_XHPROF_FLAGS_CPU);
error_reporting(0);
ini_set('display_errors', 0);
@ -32,3 +34,10 @@ switch ($version) { // Switch between API version
include __DIR__ . '/../app/app.php';
break;
}
// $data = tideways_xhprof_disable();
// $key = str_replace(['/', '.'], '_', $_GET['q']);
// file_put_contents(
// "./{$key}-appwrite.xhprof",
// serialize($data)
// );