Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 12 |
| MetricsGet | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 12 |
| __construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 4 |
|||
| handle | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 8 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Qmp\Laravel\DockerScale\Console; |
| 4 | |
| 5 | use Qmp\Laravel\CommandsLaravel\Middleware\Library\Monitoring\CreateParentProcess; |
| 6 | use Qmp\Laravel\CommandsLaravel\Middleware\Library\Monitoring\UpdateParentProcess; |
| 7 | use Qmp\Laravel\DockerScale\Retriever\Retriever; |
| 8 | use Qmp\Laravel\DockerScale\Scaler\DockerScaler; |
| 9 | use Qmp\Laravel\ToolsLaravel\Traits\Timer; |
| 10 | |
| 11 | class MetricsGet extends \Commando |
| 12 | { |
| 13 | |
| 14 | use Timer; |
| 15 | |
| 16 | /** |
| 17 | * The name and signature of the console command. |
| 18 | * |
| 19 | * @var string |
| 20 | */ |
| 21 | protected $signature = 'docker:metrics'; |
| 22 | |
| 23 | /** |
| 24 | * The console command description. |
| 25 | * |
| 26 | * @var string |
| 27 | */ |
| 28 | protected $description = 'Retrieve Docker & Http metrics'; |
| 29 | |
| 30 | /** |
| 31 | * Create a new command instance. |
| 32 | * |
| 33 | * @return void |
| 34 | */ |
| 35 | public function __construct() |
| 36 | { |
| 37 | parent::__construct(); |
| 38 | $this->middleware([ |
| 39 | CreateParentProcess::class, |
| 40 | UpdateParentProcess::class |
| 41 | ]); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Execute the console command. |
| 46 | * |
| 47 | * @return mixed |
| 48 | */ |
| 49 | public function handle() |
| 50 | { |
| 51 | $this->startTimer('total'); |
| 52 | |
| 53 | $data = $this->middlewareData(UpdateParentProcess::class) |
| 54 | ->transfert(CreateParentProcess::class, ['id']); |
| 55 | |
| 56 | Retriever::all(); |
| 57 | |
| 58 | $scaler = new DockerScaler(); |
| 59 | $scaler->run(); |
| 60 | |
| 61 | $data->log['duration'] = $this->getTimer('total'); |
| 62 | } |
| 63 | } |