gupalo / prometheus-helper
Prometheus Helper
1.3.0
2024-01-31 10:16 UTC
Requires
- php: >=8.1
- ext-json: *
- gupalo/json: *
- promphp/prometheus_client_php: ^2.9
- symfony/http-foundation: ^5.2|^6.0|^7.0
Requires (Dev)
- phpunit/phpunit: ^10.5
README
PHP Prometheus 库包装器 - promphp/prometheus_client_php
安装
composer require gupalo/prometheus-helper
使用
public static function registration(bool $isSuccess): void
{
if ($isSuccess) {
PrometheusHelper::inc('analytics_registration_success_total', 'registration success');
} else {
PrometheusHelper::inc('analytics_registration_error_total', 'registration error');
}
}
另请参阅 tests 文件夹。
如果您想设置自定义的缓存目录 - 使用 PrometheusHelper::setDir('/your/cache/dir/for/prom')。