From cf5375c8931ecf73fd92f8b68577c4b52a9be49d Mon Sep 17 00:00:00 2001 From: huangxin Date: Mon, 13 Mar 2023 17:26:54 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=20=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=A1=AC=E4=BB=B6=E7=9B=91=E6=8E=A7=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/vcpe.cfg | 5 ----- srcs/libs/configure/config.c | 5 ----- srcs/libs/configure/config_help.c | 16 ---------------- srcs/libs/include/config.h | 10 ++-------- 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/config/vcpe.cfg b/config/vcpe.cfg index 319ff48..6b9f483 100644 --- a/config/vcpe.cfg +++ b/config/vcpe.cfg @@ -24,11 +24,6 @@ application: memory = true; # 是否开启内存监控 disk = true; # 是否开启磁盘空间占用监控 sensor = true; # 是否开启传感器状态监控 - - cpu_refresh = 1; # CPU 状态刷新频率(秒) - mem_refresh = 10; # 内存状态刷新频率(秒) - disk_refresh = 10; # 磁盘状态刷新频率(秒) - sensor_refresh = 10; # 传感器状态刷新频率(秒) }; # 数据库相关配置 diff --git a/srcs/libs/configure/config.c b/srcs/libs/configure/config.c index bd68487..abe896a 100644 --- a/srcs/libs/configure/config.c +++ b/srcs/libs/configure/config.c @@ -73,11 +73,6 @@ static CFG_ITEM g_cfgItem[] = { DEF_CFG_ITEM(CFG_WATCH_MEMORY, "watch_params.memory", VAL_BOOL, "1", "Monitor memory information"), DEF_CFG_ITEM(CFG_WATCH_DISK, "watch_params.disk", VAL_BOOL, "1", "Monitor disk partition information"), DEF_CFG_ITEM(CFG_WATCH_SENSOR, "watch_params.sensor", VAL_BOOL, "1", "Sensor information refresh frequency"), - /* 系统监控设备刷频率 */ - DEF_CFG_ITEM(CFG_CPU_REFRESH, "watch_params.cpu_refresh", VAL_INT, "10", "CPU information refresh frequency"), - DEF_CFG_ITEM(CFG_MEM_REFRESH, "watch_params.mem_refresh", VAL_INT, "10", "Memory information refresh frequency"), - DEF_CFG_ITEM(CFG_DISK_REFRESH, "watch_params.disk_refresh", VAL_INT, "10", "Disk information refresh frequency"), - DEF_CFG_ITEM(CFG_SENSOR_REFRESH, "watch_params.sensor_refresh", VAL_INT, "10", "Sensor information refresh frequency"), /* 数据库相配置 */ /* Redis配置 */ #ifdef USED_REDIS diff --git a/srcs/libs/configure/config_help.c b/srcs/libs/configure/config_help.c index 49670a7..1f7c22a 100644 --- a/srcs/libs/configure/config_help.c +++ b/srcs/libs/configure/config_help.c @@ -121,22 +121,6 @@ int cfg_get_watch_sensor() { return cfg_get_bool_value(CFG_WATCH_SENSOR); } -unsigned int cfg_get_cpu_refresh_period() { - return cfg_get_integral_value(CFG_CPU_REFRESH); -} - -unsigned int cfg_get_mem_refresh_period() { - return cfg_get_integral_value(CFG_MEM_REFRESH); -} - -unsigned int cfg_get_disk_refresh_period() { - return cfg_get_integral_value(CFG_DISK_REFRESH); -} - -unsigned int cfg_get_sensor_refresh_period() { - return cfg_get_integral_value(CFG_SENSOR_REFRESH); -} - #ifdef USED_SQLITE const char *cfg_get_sqlite_db_name() { return cfg_get_string_value(CFG_DB_SQLITE_DB_NAME); diff --git a/srcs/libs/include/config.h b/srcs/libs/include/config.h index 1730a78..687e981 100644 --- a/srcs/libs/include/config.h +++ b/srcs/libs/include/config.h @@ -41,10 +41,6 @@ typedef enum { CFG_WATCH_MEMORY, CFG_WATCH_DISK, CFG_WATCH_SENSOR, - CFG_CPU_REFRESH, - CFG_MEM_REFRESH, - CFG_DISK_REFRESH, - CFG_SENSOR_REFRESH, #ifdef USED_REDIS CFG_DB_REDIS_SERVER, CFG_DB_REDIS_PORT, @@ -94,10 +90,6 @@ int cfg_get_watch_cpu(); int cfg_get_watch_memory(); int cfg_get_watch_disk(); int cfg_get_watch_sensor(); -unsigned int cfg_get_cpu_refresh_period(); -unsigned int cfg_get_mem_refresh_period(); -unsigned int cfg_get_disk_refresh_period(); -unsigned int cfg_get_sensor_refresh_period(); #ifdef USED_REDIS const char *cfg_get_redis_server(); int cfg_get_redis_port(); @@ -114,8 +106,10 @@ const char *cfg_get_mysql_database(); const char *cfg_get_sqlite_db_name(); const char *cfg_get_sqlite_passwd(); #endif +#ifdef ZEROMQ_ON int cfg_get_zero_mq_port(); const char *cfg_get_zero_mq_data_path(); +#endif const char *cfg_get_string_value(CONFIG_ITEM_ID id); c_vector cfg_get_vector(CONFIG_ITEM_ID id);