Add iterations before failure to test results

This commit is contained in:
Sky Johnson 2024-09-07 18:51:37 -05:00
parent 5277acfe39
commit c9e3c3a2d5

View File

@ -114,7 +114,8 @@ function runIterations(int $iterations, $r, array $routes) {
$start2 = microtime(true); $start2 = microtime(true);
$res = $r->lookup($method, $uri); $res = $r->lookup($method, $uri);
if ($res === 404 || $res === 405) { if ($res === 404 || $res === 405) {
echo Color::red("Failed to handle request.\n$method $res\n"."├─ URI: $uri\n├─ Path: $path\n"); echo Color::red("Failed to handle request.\n$method $res\n"."├─ URI: $uri\n└─ Path: $path\n");
echo Color::yellow("Completed $i iterations before failure.\n");
exit(1); exit(1);
} }
if ($i !== 0 && $i % ($interval) === 0) echoMemoryAndTime($i, $start2); if ($i !== 0 && $i % ($interval) === 0) echoMemoryAndTime($i, $start2);