Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ The config file (`config/netwatch.php`) contains pre-configured probes that read
```php
<?php

use Mathiasgrimm\Netwatch\Laravel\Http\Middleware\Authorize;
use Mathiasgrimm\Netwatch\Probe\HttpProbe;
use Mathiasgrimm\Netwatch\Probe\PdoProbe;
use Mathiasgrimm\Netwatch\Probe\PhpRedisProbe;
use Mathiasgrimm\Netwatch\Probe\S3Probe;
use Mathiasgrimm\Netwatch\Probe\TcpPingProbe;
use MathiasGrimm\Netwatch\Laravel\Http\Middleware\Authorize;
use MathiasGrimm\Netwatch\Probe\HttpProbe;
use MathiasGrimm\Netwatch\Probe\PdoProbe;
use MathiasGrimm\Netwatch\Probe\PhpRedisProbe;
use MathiasGrimm\Netwatch\Probe\S3Probe;
use MathiasGrimm\Netwatch\Probe\TcpPingProbe;

return [
'iterations' => (int) env('NETWATCH_ITERATIONS', 10),
Expand Down Expand Up @@ -367,9 +367,9 @@ The table shows a per-probe `Status` column and colors the total p95 against the
### Programmatic

```php
use Mathiasgrimm\Netwatch\Netwatch;
use Mathiasgrimm\Netwatch\Probe\HttpProbe;
use Mathiasgrimm\Netwatch\Probe\TcpPingProbe;
use MathiasGrimm\Netwatch\Netwatch;
use MathiasGrimm\Netwatch\Probe\HttpProbe;
use MathiasGrimm\Netwatch\Probe\TcpPingProbe;

$netwatch = new Netwatch([
'example' => ['probe' => new HttpProbe('https://example.com')],
Expand All @@ -392,10 +392,10 @@ Create a `netwatch.php` in your project root (or use `netwatch:init` to generate
```php
<?php

use Mathiasgrimm\Netwatch\Probe\PhpRedisProbe;
use Mathiasgrimm\Netwatch\Probe\PdoProbe;
use Mathiasgrimm\Netwatch\Probe\HttpProbe;
use Mathiasgrimm\Netwatch\Probe\TcpPingProbe;
use MathiasGrimm\Netwatch\Probe\PhpRedisProbe;
use MathiasGrimm\Netwatch\Probe\PdoProbe;
use MathiasGrimm\Netwatch\Probe\HttpProbe;
use MathiasGrimm\Netwatch\Probe\TcpPingProbe;

return [
'iterations' => 10,
Expand Down Expand Up @@ -535,8 +535,8 @@ new S3Probe(
Implement `ProbeInterface` to create your own:

```php
use Mathiasgrimm\Netwatch\Contract\ProbeInterface;
use Mathiasgrimm\Netwatch\Result\ProbeResult;
use MathiasGrimm\Netwatch\Contract\ProbeInterface;
use MathiasGrimm\Netwatch\Result\ProbeResult;

class MyProbe implements ProbeInterface
{
Expand Down
4 changes: 2 additions & 2 deletions bin/netwatch
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if (!$autoloaded) {
exit(1);
}

use Mathiasgrimm\Netwatch\Console\InitCommand;
use Mathiasgrimm\Netwatch\Console\NetwatchCommand;
use MathiasGrimm\Netwatch\Console\InitCommand;
use MathiasGrimm\Netwatch\Console\NetwatchCommand;
use Symfony\Component\Console\Application;

$app = new Application('netwatch', '1.0.0');
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"license": "MIT",
"autoload": {
"psr-4": {
"Mathiasgrimm\\Netwatch\\": "src/"
"MathiasGrimm\\Netwatch\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Mathiasgrimm\\Netwatch\\Tests\\": "tests/"
"MathiasGrimm\\Netwatch\\Tests\\": "tests/"
}
},
"authors": [
Expand All @@ -34,7 +34,7 @@
"extra": {
"laravel": {
"providers": [
"Mathiasgrimm\\Netwatch\\Laravel\\NetwatchServiceProvider"
"MathiasGrimm\\Netwatch\\Laravel\\NetwatchServiceProvider"
]
}
},
Expand Down
8 changes: 4 additions & 4 deletions netwatch.example.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

use Mathiasgrimm\Netwatch\Probe\HttpProbe;
use Mathiasgrimm\Netwatch\Probe\PdoProbe;
use Mathiasgrimm\Netwatch\Probe\PhpRedisProbe;
use Mathiasgrimm\Netwatch\Probe\TcpPingProbe;
use MathiasGrimm\Netwatch\Probe\HttpProbe;
use MathiasGrimm\Netwatch\Probe\PdoProbe;
use MathiasGrimm\Netwatch\Probe\PhpRedisProbe;
use MathiasGrimm\Netwatch\Probe\TcpPingProbe;

return [
'iterations' => 10,
Expand Down
10 changes: 5 additions & 5 deletions src/Console/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Console;
namespace MathiasGrimm\Netwatch\Console;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -44,10 +44,10 @@ private function template(): string
return <<<'PHP'
<?php

use Mathiasgrimm\Netwatch\Probe\PhpRedisProbe;
use Mathiasgrimm\Netwatch\Probe\PdoProbe;
use Mathiasgrimm\Netwatch\Probe\HttpProbe;
use Mathiasgrimm\Netwatch\Probe\TcpPingProbe;
use MathiasGrimm\Netwatch\Probe\PhpRedisProbe;
use MathiasGrimm\Netwatch\Probe\PdoProbe;
use MathiasGrimm\Netwatch\Probe\HttpProbe;
use MathiasGrimm\Netwatch\Probe\TcpPingProbe;

return [
'iterations' => 10,
Expand Down
6 changes: 3 additions & 3 deletions src/Console/NetwatchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Console;
namespace MathiasGrimm\Netwatch\Console;

use Mathiasgrimm\Netwatch\Netwatch;
use Mathiasgrimm\Netwatch\Result\AggregateResult;
use MathiasGrimm\Netwatch\Netwatch;
use MathiasGrimm\Netwatch\Result\AggregateResult;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableSeparator;
Expand Down
4 changes: 2 additions & 2 deletions src/Contract/ProbeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Contract;
namespace MathiasGrimm\Netwatch\Contract;

use Mathiasgrimm\Netwatch\Result\ProbeResult;
use MathiasGrimm\Netwatch\Result\ProbeResult;

interface ProbeInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Laravel/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Laravel\Console;
namespace MathiasGrimm\Netwatch\Laravel\Console;

use Illuminate\Console\Command;
use Illuminate\Support\ServiceProvider;
Expand Down
6 changes: 3 additions & 3 deletions src/Laravel/Console/NetwatchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Laravel\Console;
namespace MathiasGrimm\Netwatch\Laravel\Console;

use Illuminate\Console\Command;
use Mathiasgrimm\Netwatch\Netwatch;
use Mathiasgrimm\Netwatch\Result\AggregateResult;
use MathiasGrimm\Netwatch\Netwatch;
use MathiasGrimm\Netwatch\Result\AggregateResult;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableSeparator;
use Throwable;
Expand Down
4 changes: 2 additions & 2 deletions src/Laravel/Http/Controllers/HealthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Laravel\Http\Controllers;
namespace MathiasGrimm\Netwatch\Laravel\Http\Controllers;

use Illuminate\Http\Request;
use Mathiasgrimm\Netwatch\Netwatch;
use MathiasGrimm\Netwatch\Netwatch;

class HealthController
{
Expand Down
4 changes: 2 additions & 2 deletions src/Laravel/Http/Controllers/HealthProbeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Laravel\Http\Controllers;
namespace MathiasGrimm\Netwatch\Laravel\Http\Controllers;

use Mathiasgrimm\Netwatch\Netwatch;
use MathiasGrimm\Netwatch\Netwatch;

class HealthProbeController
{
Expand Down
4 changes: 2 additions & 2 deletions src/Laravel/Http/Middleware/Authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Laravel\Http\Middleware;
namespace MathiasGrimm\Netwatch\Laravel\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Mathiasgrimm\Netwatch\Netwatch;
use MathiasGrimm\Netwatch\Netwatch;

class Authorize
{
Expand Down
4 changes: 2 additions & 2 deletions src/Laravel/NetwatchApplicationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Laravel;
namespace MathiasGrimm\Netwatch\Laravel;

use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
use Mathiasgrimm\Netwatch\Netwatch;
use MathiasGrimm\Netwatch\Netwatch;

class NetwatchApplicationServiceProvider extends ServiceProvider
{
Expand Down
10 changes: 5 additions & 5 deletions src/Laravel/NetwatchServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Laravel;
namespace MathiasGrimm\Netwatch\Laravel;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Mathiasgrimm\Netwatch\Laravel\Console\InstallCommand;
use Mathiasgrimm\Netwatch\Laravel\Console\NetwatchCommand;
use Mathiasgrimm\Netwatch\Laravel\Http\Middleware\Authorize;
use Mathiasgrimm\Netwatch\Netwatch;
use MathiasGrimm\Netwatch\Laravel\Console\InstallCommand;
use MathiasGrimm\Netwatch\Laravel\Console\NetwatchCommand;
use MathiasGrimm\Netwatch\Laravel\Http\Middleware\Authorize;
use MathiasGrimm\Netwatch\Netwatch;
use RuntimeException;
use Throwable;

Expand Down
12 changes: 6 additions & 6 deletions src/Laravel/config/netwatch.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use Mathiasgrimm\Netwatch\Laravel\Http\Middleware\Authorize;
use Mathiasgrimm\Netwatch\Probe\HttpProbe;
use Mathiasgrimm\Netwatch\Probe\PdoProbe;
use Mathiasgrimm\Netwatch\Probe\PhpRedisProbe;
use Mathiasgrimm\Netwatch\Probe\S3Probe;
use Mathiasgrimm\Netwatch\Probe\TcpPingProbe;
use MathiasGrimm\Netwatch\Laravel\Http\Middleware\Authorize;
use MathiasGrimm\Netwatch\Probe\HttpProbe;
use MathiasGrimm\Netwatch\Probe\PdoProbe;
use MathiasGrimm\Netwatch\Probe\PhpRedisProbe;
use MathiasGrimm\Netwatch\Probe\S3Probe;
use MathiasGrimm\Netwatch\Probe\TcpPingProbe;

return [
/*
Expand Down
4 changes: 2 additions & 2 deletions src/Laravel/routes/web.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use Illuminate\Support\Facades\Route;
use Mathiasgrimm\Netwatch\Laravel\Http\Controllers\HealthController;
use Mathiasgrimm\Netwatch\Laravel\Http\Controllers\HealthProbeController;
use MathiasGrimm\Netwatch\Laravel\Http\Controllers\HealthController;
use MathiasGrimm\Netwatch\Laravel\Http\Controllers\HealthProbeController;

Route::get('/health', HealthController::class);
Route::get('/health/probes/{probe}', HealthProbeController::class);
6 changes: 3 additions & 3 deletions src/Netwatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch;
namespace MathiasGrimm\Netwatch;

use Closure;
use InvalidArgumentException;
use Mathiasgrimm\Netwatch\Contract\ProbeInterface;
use Mathiasgrimm\Netwatch\Result\AggregateResult;
use MathiasGrimm\Netwatch\Contract\ProbeInterface;
use MathiasGrimm\Netwatch\Result\AggregateResult;
use RuntimeException;
use Throwable;

Expand Down
6 changes: 3 additions & 3 deletions src/Probe/HttpProbe.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Probe;
namespace MathiasGrimm\Netwatch\Probe;

use GuzzleHttp\TransferStats;
use Illuminate\Http\Client\Factory;
use Illuminate\Http\Client\RequestException;
use Mathiasgrimm\Netwatch\Contract\ProbeInterface;
use Mathiasgrimm\Netwatch\Result\ProbeResult;
use MathiasGrimm\Netwatch\Contract\ProbeInterface;
use MathiasGrimm\Netwatch\Result\ProbeResult;

class HttpProbe implements ProbeInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/Probe/PdoProbe.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Probe;
namespace MathiasGrimm\Netwatch\Probe;

use Mathiasgrimm\Netwatch\Contract\ProbeInterface;
use Mathiasgrimm\Netwatch\Result\ProbeResult;
use MathiasGrimm\Netwatch\Contract\ProbeInterface;
use MathiasGrimm\Netwatch\Result\ProbeResult;
use PDO;
use Throwable;

Expand Down
6 changes: 3 additions & 3 deletions src/Probe/PhpRedisProbe.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Probe;
namespace MathiasGrimm\Netwatch\Probe;

use Mathiasgrimm\Netwatch\Contract\ProbeInterface;
use Mathiasgrimm\Netwatch\Result\ProbeResult;
use MathiasGrimm\Netwatch\Contract\ProbeInterface;
use MathiasGrimm\Netwatch\Result\ProbeResult;
use Redis;
use Throwable;

Expand Down
6 changes: 3 additions & 3 deletions src/Probe/S3Probe.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Probe;
namespace MathiasGrimm\Netwatch\Probe;

use Mathiasgrimm\Netwatch\Contract\ProbeInterface;
use Mathiasgrimm\Netwatch\Result\ProbeResult;
use MathiasGrimm\Netwatch\Contract\ProbeInterface;
use MathiasGrimm\Netwatch\Result\ProbeResult;

class S3Probe implements ProbeInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/Probe/TcpPingProbe.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Probe;
namespace MathiasGrimm\Netwatch\Probe;

use Mathiasgrimm\Netwatch\Contract\ProbeInterface;
use Mathiasgrimm\Netwatch\Result\ProbeResult;
use MathiasGrimm\Netwatch\Contract\ProbeInterface;
use MathiasGrimm\Netwatch\Result\ProbeResult;

class TcpPingProbe implements ProbeInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Result/AggregateResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Result;
namespace MathiasGrimm\Netwatch\Result;

class AggregateResult
{
Expand Down
2 changes: 1 addition & 1 deletion src/Result/ProbeResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Mathiasgrimm\Netwatch\Result;
namespace MathiasGrimm\Netwatch\Result;

class ProbeResult
{
Expand Down
Loading
Loading