Добавлена запись метрики времени работы приложения

This commit is contained in:
ErickSkrauch 2017-11-17 03:04:14 +03:00
parent 42b6bc561e
commit 72f546c827

View File

@ -4,6 +4,8 @@ use api\aop\AspectKernel;
use common\config\ConfigLoader; use common\config\ConfigLoader;
use yii\web\Application; use yii\web\Application;
$time = microtime(true);
require __DIR__ . '/../../vendor/autoload.php'; require __DIR__ . '/../../vendor/autoload.php';
defined('YII_DEBUG') or define('YII_DEBUG', in_array(getenv('YII_DEBUG'), ['true', '1'])); defined('YII_DEBUG') or define('YII_DEBUG', in_array(getenv('YII_DEBUG'), ['true', '1']));
@ -29,3 +31,7 @@ $config = ConfigLoader::load('api');
$application = new Application($config); $application = new Application($config);
$application->run(); $application->run();
$timeDifference = (microtime(true) - $time) * 1000;
fastcgi_finish_request();
Yii::$app->statsd->time('request.time', $timeDifference);