Skip to content

Commit 3429e66

Browse files
committed
Add Xhprof tool for profiling and performance analysis
1 parent 1cceca4 commit 3429e66

File tree

6 files changed

+334
-2
lines changed

6 files changed

+334
-2
lines changed

.docker/dev/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ USER root
99
# Install required php extensions
1010
RUN install-php-extensions zip intl exif bcmath gd pgsql redis sockets
1111

12+
# Install XHProf for profiling
13+
RUN apt-get update && apt-get install -y \
14+
graphviz \
15+
&& apt-get clean \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
RUN install-php-extensions xhprof
19+
20+
# Copy and enable XHProf configuration
21+
COPY .docker/dev/xhprof.ini /usr/local/etc/php/conf.d/xhprof.ini
22+
RUN mkdir -p /tmp/xhprof && chmod 777 /tmp/xhprof
23+
1224
# ---- Dependencies ----
1325
FROM base AS dependencies
1426

.docker/dev/xhprof.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[xhprof]
2+
extension=xhprof.so
3+
xhprof.output_dir=/tmp/xhprof

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,9 @@ AWS_USE_PATH_STYLE_ENDPOINT=false
6565

6666
VITE_APP_NAME="${APP_NAME}"
6767

68+
# Buggregator Setup
6869
VAR_DUMPER_FORMAT=server
6970
VAR_DUMPER_SERVER=ls_dev_buggregator:9912
71+
XHPROF_ENABLED=true
72+
PROFILER_ENDPOINT=http://profiler@ls_dev_buggregator:8000
73+
PROFILER_APP_NAME="${APP_NAME}"

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"laravel/pail": "^1.2.2",
2929
"laravel/pint": "^1.18",
3030
"laravel/sail": "^1.41",
31+
"maantje/xhprof-buggregator-laravel": "^0.7.0",
3132
"mockery/mockery": "^1.6",
3233
"nunomaduro/collision": "^8.6",
3334
"pestphp/pest": "^3.8",

composer.lock

Lines changed: 295 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)