Repository navigation
Stack Status Page - #270
Conversation
…to Module Introduce `Win32Native::getServicesByNames()` to fetch multiple Windows services in a single WMI query, reducing overhead when polling stack service status. Add `Module::isInstalled()` to distinguish between modules that are present but disabled versus modules that were never downloaded.
Extends StatusSnapshot to capture per-service resource usage (CPU, memory, process count) by walking process trees from service PIDs. Introduces ProcessFootprint integration and refactors ServiceHelper to return executable name lists instead of single names, enabling accurate attribution for wrapper-based services (NSSM, pg_ctl). Optimizes Win32Native service queries by replacing unreliable IN clauses with OR chains and excluding expensive StartMode property from default polling (reduces query time from ~178ms to ~12ms).
Implement comprehensive stack status monitoring accessible from the homepage, displaying real-time service states, process footprints, and resource consumption. The status snapshot collection bridges the runtime split between Apache's user PHP (without COM) and the internal engine by delegating WMI queries to a collector script and caching results for 2 seconds. Add language strings across all locales for the new UI, expose stack status as an always-silent AJAX endpoint to prevent log pollution from high-frequency telemetry polls, and enhance error handling to ensure partial failures degrade gracefully to empty metrics rather than breaking the response envelope.
…are polling - Add dynamic alert class modifier to reflect current stack status in summary banner - Update overall status count and alert styling via JavaScript on each poll - Pause polling when tab is hidden to reduce server-side collector overhead - Resume polling immediately when tab becomes visible again - Move stack status button above service list in summary card for better visibility - Increase polling interval from 3s to 5s to reduce SCM query load
…ment Extend the stack status page with a new disk usage section that displays drive free space and install size breakdown. The measurement walks ~230,000 files and takes several seconds, so it is triggered on-demand rather than included in the regular 5s poll. Results are cached server-side and restored instantly on page reload. - Add disk space collection to ProcessFootprint snapshots (drive capacity and free space) - Create new ajax.stackdisk.php endpoint for on-demand install size measurement - Add disk usage UI section with measure button and breakdown table showing size per bin/module - Add 14 new language keys across all supported languages (English, French, German, Spanish, Swedish, Hungarian) - Implement client-side measurement flow with loading states and cache-first retrieval - Include disk metrics in status snapshot resources alongside stack, host, and cores
…epancies The total bytes and files are now computed by summing the normalized parts rather than using the collector's reported total directly. This ensures the headline figure always matches the sum of visible rows. The collector's original total is still compared against the derived value, and any disagreement is logged for debugging purposes.
Add explicit line-height to stack status button for consistent vertical alignment and apply negative top offset to compensate for card header padding. Remove trailing whitespace throughout CSS file.
Filter out .git, .idea, .github directories and .gitignore, .htaccess files from disk usage calculation to report only user-removable installation size. Update disclaimer text across all language files to document the exclusion.
PR Summary by QodoAdd live stack status and on-demand disk usage monitoring
AI Description
Diagram
High-Level Assessment
Files changed (25)
|
Code Review by Qodo
1.
|
| $entry['detail'] = 'On-demand runtime'; | ||
| $entries[] = $entry; | ||
| $running++; | ||
|
|
||
| continue; | ||
| } | ||
|
|
There was a problem hiding this comment.
3. Enabled runtimes appear disabled 🐞 Bug ≡ Correctness
StatusSnapshot::build() increments the expected and running counts for an enabled on-demand runtime but never adds its STATUS_AVAILABLE value to the statuses passed to rollup(). If enabled PHP or Node.js is the only active bin, the page shows a disabled aggregate despite counting a running bin.
Agent Prompt
## Issue description
Enabled on-demand runtimes affect snapshot counts but are omitted from aggregate status calculation.
## Fix Focus Areas
- core/classes/class.statussnapshot.php[379-398]
- core/classes/class.servicestatus.php[352-382]
## Recommended Fix
Append `STATUS_AVAILABLE` to the statuses array for each enabled on-demand runtime before calling `rollup()`.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
… services When Win32Native::getServicesByNames() fails to query the Service Control Manager, return null instead of an empty array to distinguish a failed query from a successful query that matched no services. Update StatusSnapshot to handle null SCM state by reporting services as STATUS_ERROR with "Service state unavailable" rather than incorrectly marking them as not installed. This prevents blaming users for missing service registrations when the actual issue is a dropped SCM connection.
Implement single-flight execution for disk walks using an advisory file lock to prevent concurrent measurements. Add MIN_FORCED_REFRESH_INTERVAL cooldown to refuse forced refreshes when a recent measurement exists, preventing repeated expensive scans. Requests arriving during an in-flight walk now wait up to LOCK_WAIT_SECONDS for the result instead of starting duplicate work. Restrict stackdisk endpoint to POST-only requests with CSRF validation since forced refreshes can trigger expensive disk I/O operations.
Add defensive defaults throughout the stack status page to handle cases where the collector fails to populate resource metrics. Replace direct array access with null coalescing operators for host, cores, and disk measurements, and ensure the host resource structure always contains totalBytes and freeBytes keys (set to zero on failure) to prevent undefined index warnings when rendering the memory display.
No description provided.