Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.1'

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Install dependencies
run: go mod download

- name: Run tests
run: make test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.idea
/data/

# Test coverage files
coverage.out
coverage.html
/coverage*
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) -v .
CGO_ENABLED=0 $(GOBUILD) -o $(BUILD_DIR)/arm64-$(BINARY_NAME) -v .

test:
$(GOTEST) -v -cover ./...

test-coverage:
$(GOTEST) -v -coverprofile=coverage.out ./...
$(GOCMD) tool cover -func=coverage.out
$(GOCMD) tool cover -html=coverage.out -o coverage.html
@echo "Coverage report saved to coverage.html"

test-coverage-clean:
rm -f coverage.out coverage.html

build-docker:
docker build -t $(IMAGE_NAME) .

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It is designed to run locally, in Docker/Kubernetes or in VMs or shared hosting
- 📊 Exposes PHP-FPM metrics via FastCGI (using [fcgx](https://github.com/elasticphphq/fcgx))
- ⚙️ Automatically discovers PHP-FPM pools and extracts config using `php-fpm -tt`
- 🧠 Collects and exposes detailed Opcache statistics per FPM pool
- 🚦 Tracks Laravel queue sizes via `php artisan tinker --execute and Queue::size()`
- 🚦 Tracks Laravel queue sizes via `php artisan tinker --execute`
- 🧠 Provides Laravel application info (`php artisan about --json`)
- 🔌 Prometheus metrics endpoint at `/metrics`, and full JSON snapshot available at `/json`
- ⚙️ Structured configuration via CLI flags, environment variables, or config files (YAML)
Expand Down
52 changes: 0 additions & 52 deletions cmd/monitor.go

This file was deleted.

Loading