mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2025-12-23 22:37:53 -05:00
Add CpuUserPercent and CpuSystemPercent to System_Stats
This commit is contained in:
@@ -699,6 +699,8 @@ CREATE TABLE `Server_Stats` (
|
||||
`ServerId` int(10) unsigned,
|
||||
`TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
`CpuLoad` DECIMAL(5,1) default NULL,
|
||||
`CpuUserPercent` DECIMAL(5,1) default NULL,
|
||||
`CpuSystemPercent` DECIMAL(5,1) default NULL,
|
||||
`TotalMem` bigint unsigned default null,
|
||||
`FreeMem` bigint unsigned default null,
|
||||
`TotalSwap` bigint unsigned default null,
|
||||
|
||||
29
db/zm_update-1.37.37.sql
Normal file
29
db/zm_update-1.37.37.sql
Normal file
@@ -0,0 +1,29 @@
|
||||
SELECT 'Checking for CpuUserPercent in ServerStats';
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*)
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'Server_Stats'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'CpuUserPercent'
|
||||
) > 0,
|
||||
"SELECT 'Column CpuUserPercent already exists in Server_Stats'",
|
||||
"ALTER TABLE Server_Stats ADD `CpuUserPercent` DECIMAL(5,1) default NULL AFTER `CpuLoad`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
||||
SELECT 'Checking for CpuSystemPercent in ServerStats';
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*)
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'Server_Stats'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'CpuSystemPercent'
|
||||
) > 0,
|
||||
"SELECT 'Column CpuSystemPercent already exists in Server_Stats'",
|
||||
"ALTER TABLE Server_Stats ADD `CpuSystemPercent` DECIMAL(5,1) default NULL AFTER `CpuUserPercent`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
Reference in New Issue
Block a user