feat(Production): Complete production deployment infrastructure

- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
This commit is contained in:
2025-10-25 19:18:37 +02:00
parent caa85db796
commit fc3d7e6357
83016 changed files with 378904 additions and 20919 deletions

View File

@@ -6,14 +6,15 @@ namespace Tests\Framework\Queue\Performance;
use App\Framework\Database\DatabaseManager;
use App\Framework\Queue\Distribution\JobDistributionService;
use App\Framework\Queue\Jobs\JobPriority;
use App\Framework\Queue\Workers\WorkerRegistry;
use PHPUnit\Framework\TestCase;
final class SystemResourcesTest extends TestCase
{
private DatabaseManager $database;
private WorkerRegistry $workerRegistry;
private JobDistributionService $distributionService;
protected function setUp(): void
@@ -96,7 +97,7 @@ final class SystemResourcesTest extends TestCase
['batch_size' => 50, 'batches' => 10],
['batch_size' => 100, 'batches' => 10],
['batch_size' => 500, 'batches' => 5],
['batch_size' => 1000, 'batches' => 3]
['batch_size' => 1000, 'batches' => 3],
];
foreach ($testCases as $case) {
@@ -110,7 +111,7 @@ final class SystemResourcesTest extends TestCase
for ($batch = 0; $batch < $batchCount; $batch++) {
$jobs = PerformanceTestHelper::createBulkJobs($batchSize);
$batchTime = PerformanceTestHelper::measureTime(function() use ($jobs) {
$batchTime = PerformanceTestHelper::measureTime(function () use ($jobs) {
foreach ($jobs as $job) {
$this->distributionService->distributeJob($job);
}
@@ -168,7 +169,7 @@ final class SystemResourcesTest extends TestCase
for ($i = 0; $i < $iterations; $i++) {
$job = PerformanceTestHelper::createTestJob("gc_test_job_{$i}");
$operationTime = PerformanceTestHelper::measureTime(function() use ($job) {
$operationTime = PerformanceTestHelper::measureTime(function () use ($job) {
return $this->distributionService->distributeJob($job);
});
@@ -179,7 +180,7 @@ final class SystemResourcesTest extends TestCase
$gcStats[] = [
'operation' => $i,
'memory' => PerformanceTestHelper::getMemoryUsage(),
'gc_stats' => gc_status()
'gc_stats' => gc_status(),
];
}
}
@@ -305,7 +306,7 @@ final class SystemResourcesTest extends TestCase
$memorySnapshots[] = [
'time' => $elapsed,
'operations' => $operationCount,
'memory' => $memory
'memory' => $memory,
];
echo sprintf(
@@ -384,7 +385,7 @@ final class SystemResourcesTest extends TestCase
echo "Memory after distribution: {$afterDistribution['current_mb']}MB\n";
// Measure cleanup time
$cleanupTime = PerformanceTestHelper::measureTime(function() {
$cleanupTime = PerformanceTestHelper::measureTime(function () {
$this->cleanupCompletedJobs();
});
@@ -426,7 +427,7 @@ final class SystemResourcesTest extends TestCase
$distributionTimes = [];
foreach ($jobs as $job) {
$time = PerformanceTestHelper::measureTime(function() use ($job) {
$time = PerformanceTestHelper::measureTime(function () use ($job) {
return $this->distributionService->distributeJob($job);
});
$distributionTimes[] = $time;
@@ -487,7 +488,7 @@ final class SystemResourcesTest extends TestCase
for ($op = 0; $op < $operationsPerWorker; $op++) {
$job = PerformanceTestHelper::createTestJob("concurrent_job_{$worker}_{$op}");
$time = PerformanceTestHelper::measureTime(function() use ($job) {
$time = PerformanceTestHelper::measureTime(function () use ($job) {
return $this->distributionService->distributeJob($job);
});
@@ -501,7 +502,7 @@ final class SystemResourcesTest extends TestCase
return [
'times' => $times,
'total_operations' => $actualOperations,
'duration' => $endTime - $startTime
'duration' => $endTime - $startTime,
];
}
@@ -556,6 +557,7 @@ final class SystemResourcesTest extends TestCase
$capacity
);
}
return $workers;
}
@@ -614,4 +616,4 @@ final class SystemResourcesTest extends TestCase
$pdo->exec('DELETE FROM workers');
$pdo->exec('DELETE FROM jobs');
}
}
}