perfbase/joomla
Composer 安装命令:
composer require perfbase/joomla
包简介
Joomla system plugin integration for the Perfbase APM platform
README 文档
README
Perfbase for Joomla
Joomla integration for Perfbase.
This package is a thin adapter over perfbase/php-sdk. It connects Joomla request and console lifecycle events to the Perfbase SDK while leaving extension interaction, payload construction, and submission to the shared SDK.
Support Matrix
| Component | Supported |
|---|---|
| PHP | >=8.1 <9.0 |
| Joomla | 4.4 and 5.x |
| Package type | Joomla system plugin |
| Runtime contexts | HTTP and CLI |
| Perfbase SDK | ^1.0.0 |
| Perfbase PHP extension | Required at runtime |
This package supports:
- Site requests
- Administrator requests when
profile_adminis enabled - Joomla API requests as standard HTTP contexts
- Joomla console commands
This package does not currently provide:
- Dedicated Joomla scheduler or task lifecycles
- Deep component or template execution timelines beyond the main trace span
- End-to-end instrumentation tests inside full Joomla application installs
Features
- HTTP profiling via Joomla lifecycle hooks
- CLI profiling for Joomla console commands
- Low-cardinality action and span naming
- Sanitized HTTP URLs without query strings
- Include and exclude filters for HTTP and CLI
- Production-safe failure handling
- Shutdown fallback cleanup for interrupted execution paths
- Runtime config validation for malformed adapter settings
Installation
1. Download the installable ZIP
Download the perfbase-joomla-<version>.zip artifact from the matching GitHub Release.
Release ZIPs are self-contained Joomla plugin artifacts. They include the production perfbase/php-sdk dependency under the plugin's own vendor/ directory, so normal Joomla Extension Manager installs do not require a Composer install in the Joomla root.
2. Install the ZIP in Joomla
In Joomla administrator, go to:
System -> Install -> Extensions -> Upload Package File
Upload the release ZIP.
Updates
The plugin registers a Joomla update server:
https://raw.githubusercontent.com/perfbaseorg/joomla/main/updates/perfbase.xml
After the first ZIP install, Joomla can discover future releases through the administrator extension update UI. Release metadata points Joomla at the matching GitHub Release ZIP.
3. Enable the plugin
In Joomla administrator, enable:
System - Perfbase
4. Install the Perfbase PHP extension
The plugin depends on the Perfbase PHP extension at runtime. Without the extension, the plugin degrades safely but no traces will be captured.
Development install
For local development, place the source checkout under:
plugins/system/perfbase
Then install dependencies from the plugin directory:
composer install --no-dev --prefer-dist
Quick Start
- Install and enable the Perfbase PHP extension.
- Install the release ZIP through Joomla Extension Manager.
- Enable
System - Perfbasein Joomla administrator. - Configure
api_key. - Set
enabled = yes. - Start with
sample_rate = 0.1. - Leave
profile_admin = nountil you want administrator coverage explicitly.
Configuration
The plugin configuration UI is defined in perfbase.xml. Runtime normalization and validation live in ConfigResolver.php.
Core Settings
| Setting | Default | Description |
|---|---|---|
enabled |
false |
Master switch for profiling |
api_key |
empty | Required Perfbase project API key |
api_url |
https://ingress.perfbase.cloud |
Perfbase receiver URL |
sample_rate |
0.1 |
Fraction of requests and commands to profile |
timeout |
5 |
SDK request timeout in seconds |
proxy |
empty | Optional proxy URL |
flags |
8145 |
Curated Perfbase feature-flag bitmask |
Context Settings
| Setting | Default | Description |
|---|---|---|
profile_admin |
false |
Include administrator requests |
profile_http_status_codes |
200-299,500-599 |
HTTP status codes that should be submitted |
environment |
empty | Optional environment override |
app_version |
empty | Optional application-version override |
include_http |
* |
Newline-separated HTTP include filters |
exclude_http |
empty | Newline-separated HTTP exclude filters |
include_console |
* |
Newline-separated CLI include filters |
exclude_console |
empty | Newline-separated CLI exclude filters |
Error Handling
| Setting | Default | Description |
|---|---|---|
debug |
false |
Re-throw profiling errors during development |
log_errors |
true |
Log profiling errors when debug mode is off |
Filter Syntax
HTTP and CLI filters support:
*or.*to match everything- glob patterns like
cache:*orapi/* - regex patterns like
/^GET /
Examples:
include_http
*
GET com_content:article:display
api
exclude_http
/administrator/cache/*
/health
include_console
cache:*
database:*
Filters are matched against normalized identifiers rather than raw query-heavy URLs.
profile_http_status_codes accepts comma-separated values, newline-separated values, and ranges such as 200-299,500-599 or 200,201,404. The runtime config is normalized to an integer allowlist. Leave it blank if you want to disable HTTP trace submission entirely.
Runtime Behavior
HTTP
The plugin uses:
onAfterInitialiseonAfterRouteonAfterDispatchonAfterRespondregister_shutdown_function
HTTP actions are normalized to:
METHOD option:view:taskwhen Joomla route metadata existsMETHOD /sanitized/pathwhen it does not
Examples:
GET com_content:article:displayPOST /users/{id}
By default, 2xx and 5xx HTTP responses are submitted. A 404 will still be profiled in-process, but the trace is discarded unless profile_http_status_codes includes 404.
CLI
CLI spans are derived from the first non-option command token in $_SERVER['argv'].
Example:
cache:clean->console_cache_clean
Captured Attributes
HTTP Attributes
source=httpactionhttp_methodhttp_urlhttp_status_codeuser_ipuser_agentuser_idhostnamephp_versionenvironmentapp_versionjoomla.clientjoomla.optionjoomla.viewjoomla.taskjoomla.format
Notes:
http_urlexcludes the query stringactionis low-cardinality by design- administrator requests are excluded unless
profile_adminis enabled
CLI Attributes
source=consoleactioncli.commandhostnamephp_versionenvironmentapp_version
Operational Notes
- If the SDK cannot be initialized, the plugin fails open and does not break the host application.
- If the Perfbase extension is unavailable, the plugin no-ops safely.
- Invalid adapter config is validated at boot and logged in production mode.
- In production, profiling errors are logged only when
log_errorsis enabled. - In development, set
debug = yesif you want profiling errors to surface immediately.
Verification
Current package verification:
- PHPUnit: passing
- PHPStan: passing on
src/ - Overall line coverage:
99.52% - Overall method coverage:
98.55%
Key class coverage:
PerfbasePlugin.php:100%methods,100%linesHttpRequestLifecycle.php:100%methods,100%linesSpanNaming.php:100%methods,100%lines
CI coverage includes:
- the supported PHP baseline
- PHPUnit
- PHPStan
- Joomla framework-package smoke checks for the supported
4.4and5.xdependency lines - both HTTP and CLI smoke paths via
tests/Host/joomla-smoke.php - provider autoload coverage via
tests/Host/provider-autoload-smoke.php - local CMS stubs layered on top of
joomla/diandjoomla/event
The smoke job is not a full joomla/cms application install. It validates adapter compatibility against the supported Joomla framework-package lines plus local CMS stubs.
Commands used during development:
composer run test
./vendor/bin/phpstan analyse --memory-limit=2G --debug src
Release artifacts are built automatically when a v<semver> tag is pushed on a commit reachable from main. The release workflow checks that the tag version matches perfbase.xml, builds dist/perfbase-joomla-<version>.zip, verifies the ZIP contents, attaches it to the GitHub Release, and commits updated Joomla update metadata to updates/perfbase.xml on main.
To build the same ZIP locally:
bin/build-release-zip v1.0.0 bin/verify-release-zip dist/perfbase-joomla-1.0.0.zip bin/update-joomla-update-metadata v1.0.0 bin/verify-joomla-update-metadata
In this sandbox, composer run phpstan may fail because PHPStan tries to open a local TCP worker socket. The direct command above was used for the clean static-analysis run.
Development
composer install
composer run test
./vendor/bin/phpstan analyse --memory-limit=2G --debug src
Important files:
perfbase.xmlservices/provider.phpupdates/perfbase.xmlConfigResolver.phpPerfbasePlugin.phptests/ci.yml
Documentation
Full documentation is available at perfbase.com/docs.
- Docs: perfbase.com/docs
- Issues: github.com/perfbaseorg/joomla/issues
- Support: support@perfbase.com
License
Apache-2.0. See LICENSE.txt.
perfbase/joomla 适用场景与选型建议
perfbase/joomla 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「monitoring」 「profiling」 「joomla」 「apm」 「Perfbase」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 perfbase/joomla 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 perfbase/joomla 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 perfbase/joomla 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Quick profiling of your code for Laravel
A Symfony bundle for chameleon-system/sanitycheck
SoftWax Health Check Bundle for Symfony framework
1Pilot client for Symfony
Excimetry PHP package. Bridge between ext-eximer and open telemetry
Statsd (Object Oriented) client library for PHP
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2026-04-08