mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
The UGC server records, with each successful make's time, the worker
thread's CPU time for it and the memory it estimated the job needs (the
figure its memory budget counts; not a measurement)
(process_cpu_ms and process_memory_kb on ugc and ugc_modular_build;
migrations sqlite 74, mysql 91). The UGC page shows them with the time
and duration ("took 12.4 s, CPU 11.9 s, ~96 MB RAM (est.)"), and
durations use the largest units that fit, up to days.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1.7 KiB
SQL
26 lines
1.7 KiB
SQL
/* UGC server: process_cpu_ms is the CPU time the worker thread spent on the last successful make, process_memory_kb
|
|
the memory the UGC server estimated for it (what its memory budget counts; not measured), for the dashboard. */
|
|
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE ugc ADD COLUMN process_cpu_ms INT UNSIGNED NOT NULL DEFAULT 0', 'DO 0') FROM information_schema.columns
|
|
WHERE table_schema = DATABASE() AND table_name = 'ugc' AND column_name = 'process_cpu_ms');
|
|
PREPARE dlu_column_stmt FROM @dlu_column;
|
|
EXECUTE dlu_column_stmt;
|
|
DEALLOCATE PREPARE dlu_column_stmt;
|
|
|
|
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE ugc ADD COLUMN process_memory_kb INT UNSIGNED NOT NULL DEFAULT 0', 'DO 0') FROM information_schema.columns
|
|
WHERE table_schema = DATABASE() AND table_name = 'ugc' AND column_name = 'process_memory_kb');
|
|
PREPARE dlu_column_stmt FROM @dlu_column;
|
|
EXECUTE dlu_column_stmt;
|
|
DEALLOCATE PREPARE dlu_column_stmt;
|
|
|
|
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE ugc_modular_build ADD COLUMN process_cpu_ms INT UNSIGNED NOT NULL DEFAULT 0', 'DO 0') FROM information_schema.columns
|
|
WHERE table_schema = DATABASE() AND table_name = 'ugc_modular_build' AND column_name = 'process_cpu_ms');
|
|
PREPARE dlu_column_stmt FROM @dlu_column;
|
|
EXECUTE dlu_column_stmt;
|
|
DEALLOCATE PREPARE dlu_column_stmt;
|
|
|
|
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE ugc_modular_build ADD COLUMN process_memory_kb INT UNSIGNED NOT NULL DEFAULT 0', 'DO 0') FROM information_schema.columns
|
|
WHERE table_schema = DATABASE() AND table_name = 'ugc_modular_build' AND column_name = 'process_memory_kb');
|
|
PREPARE dlu_column_stmt FROM @dlu_column;
|
|
EXECUTE dlu_column_stmt;
|
|
DEALLOCATE PREPARE dlu_column_stmt;
|