diff options
author | Simon Rettberg | 2020-04-25 20:49:12 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-04-25 20:49:12 +0200 |
commit | 4247bb518e3e6d1a2ec601ea4597edf5eb3cc72e (patch) | |
tree | 78bf5e51a019aa50acbdc95bbe03b1bb24d757f0 /modules-available/statistics/install.inc.php | |
parent | Minor tweaks and cleanups (diff) | |
download | slx-admin-4247bb518e3e6d1a2ec601ea4597edf5eb3cc72e.tar.gz slx-admin-4247bb518e3e6d1a2ec601ea4597edf5eb3cc72e.tar.xz slx-admin-4247bb518e3e6d1a2ec601ea4597edf5eb3cc72e.zip |
[statistics] Track CPU-load and standby failures of clients
Diffstat (limited to 'modules-available/statistics/install.inc.php')
-rw-r--r-- | modules-available/statistics/install.inc.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules-available/statistics/install.inc.php b/modules-available/statistics/install.inc.php index 2831905d..1fb70aef 100644 --- a/modules-available/statistics/install.inc.php +++ b/modules-available/statistics/install.inc.php @@ -250,7 +250,7 @@ if (!tableHasColumn('machine', 'live_tmpsize')) { ADD INDEX `live_tmpfree` (`live_tmpfree`), ADD INDEX `live_memfree` (`live_memfree`)"); if ($ret === false) { - finalResponse(UPDATE_FAILED, 'Adding state column to machine table failed: ' . Database::lastError()); + finalResponse(UPDATE_FAILED, 'Adding mem-stat columns to machine table failed: ' . Database::lastError()); } $res[] = UPDATE_DONE; } @@ -273,5 +273,17 @@ while ($row = $res2->fetch(PDO::FETCH_ASSOC)) { $res[] = tableAddConstraint('setting_machine', 'machineuuid', 'machine', 'machineuuid', 'ON UPDATE CASCADE ON DELETE CASCADE'); +// 2020-04-25: Track enter/exit standby count, live CPU load +if (!tableHasColumn('machine', 'live_cpuload')) { + $ret = Database::exec("ALTER TABLE `machine` + ADD COLUMN `live_cpuload` tinyint(3) UNSIGNED NOT NULL DEFAULT '255' AFTER `live_memfree`, + ADD COLUMN `standbysem` tinyint(3) UNSIGNED NOT NULL DEFAULT '0', + ADD INDEX `live_cpuload` (`live_cpuload`)"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Adding live_cpuload column to machine table failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + // Create response responseFromArray($res); |