|
2 | 2 | declare(strict_types=1); |
3 | 3 |
|
4 | 4 | /** |
5 | | - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) |
6 | | - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) |
| 5 | + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) |
| 6 | + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) |
7 | 7 | * |
8 | 8 | * Licensed under The MIT License |
9 | 9 | * Redistributions of files must retain the above copyright notice. |
10 | 10 | * |
11 | | - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) |
12 | | - * @link http://cakephp.org CakePHP(tm) Project |
| 11 | + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) |
| 12 | + * @link https://cakephp.org CakePHP(tm) Project |
13 | 13 | * @since DebugKit 1.0 |
14 | | - * @license http://www.opensource.org/licenses/mit-license.php MIT License |
| 14 | + * @license https://www.opensource.org/licenses/mit-license.php MIT License |
15 | 15 | */ |
16 | 16 | namespace DebugKit\Command; |
17 | 17 |
|
@@ -54,7 +54,7 @@ public function execute(Arguments $args, ConsoleIo $io): ?int |
54 | 54 | $options = array_merge($defaults, $args->getOptions()); |
55 | 55 | $times = []; |
56 | 56 |
|
57 | | - $io->out(Text::insert(__d('debug_kit', '-> Testing :url'), compact('url'))); |
| 57 | + $io->out(Text::insert('-> Testing :url', compact('url'))); |
58 | 58 | $io->out(''); |
59 | 59 | for ($i = 0; $i < $options['n']; $i++) { |
60 | 60 | /** @psalm-suppress PossiblyInvalidOperand */ |
@@ -84,25 +84,25 @@ protected function _results($times) |
84 | 84 | $duration = array_sum($times); |
85 | 85 | $requests = count($times); |
86 | 86 |
|
87 | | - $this->io->out(Text::insert(__d('debug_kit', 'Total Requests made: :requests'), compact('requests'))); |
88 | | - $this->io->out(Text::insert(__d('debug_kit', 'Total Time elapsed: :duration (seconds)'), compact('duration'))); |
| 87 | + $this->io->out(Text::insert('Total Requests made: :requests', compact('requests'))); |
| 88 | + $this->io->out(Text::insert('Total Time elapsed: :duration (seconds)', compact('duration'))); |
89 | 89 |
|
90 | 90 | $this->io->out(''); |
91 | 91 |
|
92 | | - $this->io->out(Text::insert(__d('debug_kit', 'Requests/Second: :rps req/sec'), [ |
| 92 | + $this->io->out(Text::insert('Requests/Second: :rps req/sec', [ |
93 | 93 | 'rps' => round($requests / $duration, 3), |
94 | 94 | ])); |
95 | 95 |
|
96 | | - $this->io->out(Text::insert(__d('debug_kit', 'Average request time: :average-time seconds'), [ |
| 96 | + $this->io->out(Text::insert('Average request time: :average-time seconds', [ |
97 | 97 | 'average-time' => round($duration / $requests, 3), |
98 | 98 | ])); |
99 | 99 |
|
100 | | - $this->io->out(Text::insert(__d('debug_kit', 'Standard deviation of average request time: :std-dev'), [ |
| 100 | + $this->io->out(Text::insert('Standard deviation of average request time: :std-dev', [ |
101 | 101 | 'std-dev' => round($this->_deviation($times, true), 3), |
102 | 102 | ])); |
103 | 103 |
|
104 | 104 | if (!empty($times)) { |
105 | | - $this->io->out(Text::insert(__d('debug_kit', 'Longest/shortest request: :longest sec/:shortest sec'), [ |
| 105 | + $this->io->out(Text::insert('Longest/shortest request: :longest sec/:shortest sec', [ |
106 | 106 | 'longest' => round(max($times), 3), |
107 | 107 | 'shortest' => round(min($times), 3), |
108 | 108 | ])); |
@@ -161,32 +161,28 @@ protected function _deviation($times, $sample = true) |
161 | 161 | */ |
162 | 162 | protected function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser |
163 | 163 | { |
164 | | - $parser->setDescription(__d( |
165 | | - 'debug_kit', |
| 164 | + $parser->setDescription( |
166 | 165 | 'Allows you to obtain some rough benchmarking statistics' . |
167 | 166 | 'about a fully qualified URL.' |
168 | | - )) |
| 167 | + ) |
169 | 168 | ->addArgument('url', [ |
170 | | - 'help' => __d('debug_kit', 'The URL to request.'), |
| 169 | + 'help' => 'The URL to request.', |
171 | 170 | 'required' => true, |
172 | 171 | ]) |
173 | 172 | ->addOption('n', [ |
174 | 173 | 'default' => 10, |
175 | | - 'help' => __d('debug_kit', 'Number of iterations to perform.'), |
| 174 | + 'help' => 'Number of iterations to perform.', |
176 | 175 | ]) |
177 | 176 | ->addOption('t', [ |
178 | 177 | 'default' => 100, |
179 | | - 'help' => __d( |
180 | | - 'debug_kit', |
181 | | - 'Maximum total time for all iterations, in seconds.' . |
182 | | - 'If a single iteration takes more than the timeout, only one request will be made' |
183 | | - ), |
| 178 | + 'help' => |
| 179 | + 'Maximum total time for all iterations, in seconds. ' . |
| 180 | + 'If a single iteration takes more than the timeout, only one request will be made', |
184 | 181 | ]) |
185 | | - ->setEpilog(__d( |
186 | | - 'debug_kit', |
| 182 | + ->setEpilog( |
187 | 183 | 'Example Use: `cake benchmark --n 10 --t 100 http://localhost/testsite`. ' . |
188 | 184 | '<info>Note:</info> this benchmark does not include browser render times.' |
189 | | - )); |
| 185 | + ); |
190 | 186 |
|
191 | 187 | return $parser; |
192 | 188 | } |
|
0 commit comments