macfly/yii2-pinpoint-plugin

用于监控Yii2框架的Pinpoint插件

安装次数: 11,644

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 2

开放问题: 0

类型:yii2-extension

0.3.1 2022-09-20 12:04 UTC

This package is auto-updated.

Last update: 2024-09-20 16:18:25 UTC


README

Pinpoint是一款用于Java / PHP编写的大规模分布式系统的APM(应用性能管理)工具。受Dapper启发,Pinpoint通过跟踪跨分布式应用程序的事务,提供了一种解决方案,帮助分析系统的整体结构及其组件之间的相互连接。

Pinpoint支持Java、PHP和Python应用程序自省。

对于PHP,您需要安装pinpoint-c-agent,并将插件添加到pinpoint-php-aop,以便工作。

此扩展提供了一个简单的方法,将Pinpoint与基于Yii2框架的PHP应用程序集成。

要使用此扩展,您需要执行以下操作

安装

安装此扩展的首选方式是通过composer

运行以下命令之一

composer require --prefer-dist macfly/yii2-pinpoint-plugin

或者

"macfly/yii2-pinpoint-plugin": "dev-main"

将以下内容添加到composer.json中的require部分。

配置

更新您的Yii2应用程序中的web/index.php,添加require_once __DIR__. '/../vendor/macfly/yii2-pinpoint-plugin/src/yii.php';

<?php

// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';

$config = require __DIR__ . '/../config/web.php';

require_once __DIR__. '/../vendor/macfly/yii2-pinpoint-plugin/src/yii.php';

$app = new yii\web\Application($config);
$app->run();

同样,对于yii也添加require_once __DIR__. '/vendor/macfly/yii2-pinpoint-plugin/src/yii.php';

#!/usr/bin/env php
<?php
/**
 * Yii console bootstrap file.
 *
 * @link https://yiiframework.cn/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license https://yiiframework.cn/license/
 */

defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/vendor/yiisoft/yii2/Yii.php';

$config = require __DIR__ . '/config/console.php';

require_once __DIR__. '/vendor/macfly/yii2-pinpoint-plugin/src/yii.php';

$application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);