Files
claudetools/docs/archives/zombie-process-debugging/monitor_zombies.ps1
Mike Swanson 06f7617718 feat: Major directory reorganization and cleanup
Reorganized project structure for better maintainability and reduced
disk usage by 95.9% (11 GB -> 451 MB).

Directory Reorganization (85% reduction in root files):
- Created docs/ with subdirectories (deployment, testing, database, etc.)
- Created infrastructure/vpn-configs/ for VPN scripts
- Moved 90+ files from root to organized locations
- Archived obsolete documentation (context system, offline mode, zombie debugging)
- Moved all test files to tests/ directory
- Root directory: 119 files -> 18 files

Disk Cleanup (10.55 GB recovered):
- Deleted Rust build artifacts: 9.6 GB (target/ directories)
- Deleted Python virtual environments: 161 MB (venv/ directories)
- Deleted Python cache: 50 KB (__pycache__/)

New Structure:
- docs/ - All documentation organized by category
- docs/archives/ - Obsolete but preserved documentation
- infrastructure/ - VPN configs and SSH setup
- tests/ - All test files consolidated
- logs/ - Ready for future logs

Benefits:
- Cleaner root directory (18 vs 119 files)
- Logical organization of documentation
- 95.9% disk space reduction
- Faster navigation and discovery
- Better portability (build artifacts excluded)

Build artifacts can be regenerated:
- Rust: cargo build --release (5-15 min per project)
- Python: pip install -r requirements.txt (2-3 min)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 20:42:28 -07:00

79 lines
2.7 KiB
PowerShell

# Zombie Process Monitor - Test Phase 1 Fixes
# Run this before and after 30-minute test period
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$OutputFile = "D:\ClaudeTools\zombie_test_results.txt"
Write-Host "[OK] Zombie Process Monitor - $Timestamp" -ForegroundColor Green
Write-Host ""
# Count target processes
$GitProcesses = @(Get-Process | Where-Object { $_.ProcessName -like "*git*" })
$BashProcesses = @(Get-Process | Where-Object { $_.ProcessName -like "*bash*" })
$SSHProcesses = @(Get-Process | Where-Object { $_.ProcessName -like "*ssh*" })
$ConhostProcesses = @(Get-Process | Where-Object { $_.ProcessName -like "*conhost*" })
$PythonProcesses = @(Get-Process | Where-Object { $_.ProcessName -like "*python*" })
$GitCount = $GitProcesses.Count
$BashCount = $BashProcesses.Count
$SSHCount = $SSHProcesses.Count
$ConhostCount = $ConhostProcesses.Count
$PythonCount = $PythonProcesses.Count
$TotalCount = $GitCount + $BashCount + $SSHCount + $ConhostCount + $PythonCount
# Memory info
$OS = Get-WmiObject Win32_OperatingSystem
$TotalMemoryGB = [math]::Round($OS.TotalVisibleMemorySize / 1MB, 2)
$FreeMemoryGB = [math]::Round($OS.FreePhysicalMemory / 1MB, 2)
$UsedMemoryGB = [math]::Round($TotalMemoryGB - $FreeMemoryGB, 2)
$MemoryUsagePercent = [math]::Round(($UsedMemoryGB / $TotalMemoryGB) * 100, 1)
# Display results
Write-Host "Process Counts:" -ForegroundColor Cyan
Write-Host " Git: $GitCount"
Write-Host " Bash: $BashCount"
Write-Host " SSH: $SSHCount"
Write-Host " Conhost: $ConhostCount"
Write-Host " Python: $PythonCount"
Write-Host " ---"
Write-Host " TOTAL: $TotalCount" -ForegroundColor Yellow
Write-Host ""
Write-Host "Memory Usage:" -ForegroundColor Cyan
Write-Host " Total: ${TotalMemoryGB} GB"
Write-Host " Used: ${UsedMemoryGB} GB (${MemoryUsagePercent}%)"
Write-Host " Free: ${FreeMemoryGB} GB"
Write-Host ""
# Save to file
$LogEntry = @"
========================================
Timestamp: $Timestamp
========================================
Process Counts:
Git: $GitCount
Bash: $BashCount
SSH: $SSHCount
Conhost: $ConhostCount
Python: $PythonCount
TOTAL: $TotalCount
Memory Usage:
Total: ${TotalMemoryGB} GB
Used: ${UsedMemoryGB} GB (${MemoryUsagePercent}%)
Free: ${FreeMemoryGB} GB
"@
Add-Content -Path $OutputFile -Value $LogEntry
Write-Host "[OK] Results logged to: $OutputFile" -ForegroundColor Green
Write-Host ""
Write-Host "TESTING INSTRUCTIONS:" -ForegroundColor Yellow
Write-Host "1. Note the TOTAL count above (baseline)"
Write-Host "2. Work normally for 30 minutes"
Write-Host "3. Run this script again"
Write-Host "4. Compare TOTAL counts:"
Write-Host " - Old behavior: ~505 new processes in 30min"
Write-Host " - Fixed behavior: ~75 new processes in 30min"
Write-Host ""