bootstrapWeb(); \$end = microtime(true); echo number_format((\$end - \$start) * 1000, 2) . \"ms\"; " 2>/dev/null'); $endTime = microtime(true); $totalTime = ($endTime - $startTime) * 1000; // Extract the bootstrap time from output if (preg_match('/(\d+\.?\d*)ms/', $output, $matches)) { $bootstrapTime = (float)$matches[1]; echo $bootstrapTime . "ms (bootstrap time)\n"; $times[] = $bootstrapTime; } else { echo "ERROR - could not measure\n"; echo "Output: " . trim($output) . "\n"; } } if (! empty($times)) { echo "\n📊 Results:\n"; echo " Average: " . number_format(array_sum($times) / count($times), 2) . "ms\n"; echo " Min: " . number_format(min($times), 2) . "ms\n"; echo " Max: " . number_format(max($times), 2) . "ms\n"; $avgTime = array_sum($times) / count($times); if ($avgTime > 3000) { echo "\n❌ PROBLEM: Bootstrap taking > 3000ms\n"; echo "This indicates the Discovery Service cache is not working!\n"; } elseif ($avgTime > 500) { echo "\n⚠️ WARNING: Bootstrap taking > 500ms\n"; echo "Cache might not be optimal.\n"; } else { echo "\n✅ Good: Bootstrap time is acceptable\n"; } }