Skip to content

Commit

Permalink
Format code by the latest cs-fixer. (#6617)
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo authored Mar 23, 2024
1 parent f160712 commit cf828c0
Show file tree
Hide file tree
Showing 60 changed files with 66 additions and 10 deletions.
3 changes: 2 additions & 1 deletion publish/metric.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use Hyperf\Metric\Adapter\Prometheus\Constants;
use Hyperf\Metric\Adapter\Prometheus\MetricFactory;

use function Hyperf\Support\env;

Expand All @@ -25,7 +26,7 @@
'buffer_size' => env('METRIC_BUFFER_SIZE', 200),
'metric' => [
'prometheus' => [
'driver' => Hyperf\Metric\Adapter\Prometheus\MetricFactory::class,
'driver' => MetricFactory::class,
'mode' => Constants::SCRAPE_MODE,
'namespace' => env('APP_NAME', 'skeleton'),
'redis_config' => env('PROMETHEUS_REDIS_CONFIG', 'default'),
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/InfluxDB/MetricFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\InfluxDB;

use Hyperf\Contract\ConfigInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/NoOp/Counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\NoOp;

use Hyperf\Metric\Contract\CounterInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/NoOp/Gauge.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\NoOp;

use Hyperf\Metric\Contract\GaugeInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/NoOp/Histogram.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\NoOp;

use Hyperf\Metric\Contract\HistogramInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/NoOp/MetricFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\NoOp;

use Hyperf\Coordinator\Constants;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Prometheus/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\Prometheus;

class Constants
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Prometheus/Counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\Prometheus;

use Hyperf\Metric\Contract\CounterInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Prometheus/Gauge.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\Prometheus;

use Hyperf\Metric\Contract\GaugeInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Prometheus/Histogram.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\Prometheus;

use Hyperf\Metric\Contract\HistogramInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Prometheus/MetricFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\Prometheus;

use GuzzleHttp\Exception\GuzzleException;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Prometheus/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\Prometheus;

use Hyperf\Codec\Json;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Prometheus/RedisStorageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\Prometheus;

use Hyperf\Contract\ConfigInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/RemoteProxy/Counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\RemoteProxy;

use Hyperf\Context\ApplicationContext;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/RemoteProxy/Gauge.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\RemoteProxy;

use Hyperf\Context\ApplicationContext;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/RemoteProxy/Histogram.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\RemoteProxy;

use Hyperf\Context\ApplicationContext;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/RemoteProxy/MetricCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\RemoteProxy;

use Hyperf\Metric\Contract\MetricCollectorInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/RemoteProxy/MetricCollectorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\RemoteProxy;

use Hyperf\Contract\ConfigInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/RemoteProxy/MetricFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\RemoteProxy;

use Hyperf\Metric\Contract\CounterInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/StatsD/Counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\StatsD;

use Domnikl\Statsd\Client;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/StatsD/Gauge.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\StatsD;

use Domnikl\Statsd\Client;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/StatsD/Histogram.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\StatsD;

use Domnikl\Statsd\Client;
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/StatsD/MetricFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Adapter\StatsD;

use Domnikl\Statsd\Client;
Expand Down
1 change: 1 addition & 0 deletions src/Annotation/Counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Annotation;

use Attribute;
Expand Down
1 change: 1 addition & 0 deletions src/Annotation/Histogram.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Annotation;

use Attribute;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/CounterAnnotationAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Aspect;

use Hyperf\Di\Aop\AbstractAspect;
Expand Down
1 change: 1 addition & 0 deletions src/Aspect/HistogramAnnotationAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Aspect;

use Hyperf\Di\Aop\AbstractAspect;
Expand Down
1 change: 1 addition & 0 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric;

use Domnikl\Statsd\Connection;
Expand Down
1 change: 1 addition & 0 deletions src/Contract/CounterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Contract;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Contract/GaugeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Contract;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Contract/HistogramInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Contract;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Contract/MetricCollectorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Contract;

interface MetricCollectorInterface
Expand Down
1 change: 1 addition & 0 deletions src/Contract/MetricFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Contract;

interface MetricFactoryInterface
Expand Down
1 change: 1 addition & 0 deletions src/CoroutineServerStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric;

use Hyperf\Contract\Arrayable;
Expand Down
1 change: 1 addition & 0 deletions src/Event/MetricFactoryReady.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Event;

use Hyperf\Metric\Contract\MetricFactoryInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Exception;

class InvalidArgumentException extends \InvalidArgumentException
Expand Down
1 change: 1 addition & 0 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Exception;

class RuntimeException extends \RuntimeException
Expand Down
4 changes: 1 addition & 3 deletions src/Listener/DBPoolWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Listener;

use Hyperf\Contract\ConfigInterface;
Expand All @@ -27,9 +28,6 @@ public function getPrefix()
return 'mysql';
}

/**
* {@inheritdoc}
*/
public function process(object $event): void
{
$config = $this->container->get(ConfigInterface::class);
Expand Down
1 change: 1 addition & 0 deletions src/Listener/MetricBufferWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Listener;

use Hyperf\Contract\ConfigInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/OnBeforeHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Listener;

use Hyperf\Command\Event\AfterExecute;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/OnCoroutineServerStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Listener;

use Hyperf\Contract\ConfigInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/OnMetricFactoryReady.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Listener;

use Hyperf\Contract\ConfigInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/OnPipeMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Listener;

use Hyperf\Coroutine\Coroutine;
Expand Down
4 changes: 3 additions & 1 deletion src/Listener/OnWorkerStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Listener;

use Hyperf\Contract\ConfigInterface;
Expand All @@ -23,6 +24,7 @@
use Hyperf\Metric\MetricSetter;
use Psr\Container\ContainerInterface;
use Psr\EventDispatcher\EventDispatcherInterface;
use Swoole\Server;

use function gc_status;
use function getrusage;
Expand Down Expand Up @@ -124,7 +126,7 @@ public function process(object $event): void

$timerInterval = $this->config->get('metric.default_metric_interval', 5);
$timerId = $this->timer->tick($timerInterval, function () use ($metrics) {
$server = $this->container->get(\Swoole\Server::class);
$server = $this->container->get(Server::class);
$serverStats = $server->stats();
$this->trySet('gc_', $metrics, gc_status());
$this->trySet('', $metrics, getrusage());
Expand Down
1 change: 1 addition & 0 deletions src/Listener/PoolWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\Metric\Listener;

use Hyperf\Contract\ConfigInterface;
Expand Down
Loading

0 comments on commit cf828c0

Please sign in to comment.