mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
Fix the path of CoroutineServerStats
(#5378)
This commit is contained in:
parent
7885e6ba43
commit
2adfa8c482
@ -9,7 +9,7 @@ declare(strict_types=1);
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
namespace Hyperf\Server;
|
||||
namespace Hyperf\Metric;
|
||||
|
||||
use Hyperf\Contract\Arrayable;
|
||||
|
@ -18,10 +18,10 @@ use Hyperf\Coordinator\Timer;
|
||||
use Hyperf\Engine\Coroutine as Co;
|
||||
use Hyperf\Event\Contract\ListenerInterface;
|
||||
use Hyperf\Metric\Contract\MetricFactoryInterface;
|
||||
use Hyperf\Metric\CoroutineServerStats;
|
||||
use Hyperf\Metric\Event\MetricFactoryReady;
|
||||
use Hyperf\Metric\MetricFactoryPicker;
|
||||
use Hyperf\Metric\MetricSetter;
|
||||
use Hyperf\Server\CoroutineServerStats;
|
||||
use Hyperf\Utils\Coroutine;
|
||||
use Hyperf\Utils\System;
|
||||
use Psr\Container\ContainerInterface;
|
||||
@ -99,7 +99,9 @@ class OnMetricFactoryReady implements ListenerInterface
|
||||
if ($server instanceof SwooleServer) {
|
||||
$serverStatsFactory = fn (): array => $server->stats();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
if (! $serverStatsFactory) {
|
||||
$serverStatsFactory = fn (): array => $this->container->get(CoroutineServerStats::class)->toArray();
|
||||
}
|
||||
}
|
||||
|
@ -12,8 +12,8 @@ declare(strict_types=1);
|
||||
namespace Hyperf\Metric\Middleware;
|
||||
|
||||
use Hyperf\HttpServer\Router\Dispatched;
|
||||
use Hyperf\Metric\CoroutineServerStats;
|
||||
use Hyperf\Metric\Timer;
|
||||
use Hyperf\Server\CoroutineServerStats;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
|
Loading…
Reference in New Issue
Block a user