diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 8fdbe4e81..5db168582 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1163,4 +1163,7 @@ mm_logo_detection_reject=Logo Detection Reject mm_face_recognization_monit=Face Recognization Monitoring mm_face_recognization_reject=Face Recognization Reject -app_topic_domain_monit=Topic Website Momotoring \ No newline at end of file +app_topic_domain_monit=Topic Website Momotoring +ASN_POLICY_REJECT=ASN Policy Control +ASN_POLICY_MONIT=ASN Policy Monitoring +p2p_monit=P2P Monitoring \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 3c8041922..2f394433f 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1166,4 +1166,7 @@ mm_logo_detection_monit=Logo Detection Monitoring mm_logo_detection_reject=Logo Detection Reject mm_face_recognization_monit=Face Recognization Monitoring mm_face_recognization_reject=Face Recognization Reject -app_topic_domain_monit=Topic Website Momotoring \ No newline at end of file +app_topic_domain_monit=Topic Website Momotoring +ASN_POLICY_REJECT=ASN Policy Control +ASN_POLICY_MONIT=ASN Policy Monitoring +p2p_monit=P2P Monitoring \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index e9b5a2fb4..fb381641a 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1160,4 +1160,7 @@ mm_logo_detection_monit=\u53F0\u6807\u8BC6\u522B\u76D1\u6D4B mm_logo_detection_reject=\u53F0\u6807\u8BC6\u522B\u963B\u65AD mm_face_recognization_monit=\u4EBA\u8138\u8BC6\u522B\u76D1\u6D4B mm_face_recognization_reject=\u4EBA\u8138\u8BC6\u522B\u963B\u65AD -app_topic_domain_monit=\u4E3B\u9898\u7F51\u7AD9\u76D1\u6D4B \ No newline at end of file +app_topic_domain_monit=\u4E3B\u9898\u7F51\u7AD9\u76D1\u6D4B +ASN_POLICY_REJECT=ASN\u7B56\u7565\u7BA1\u63A7 +ASN_POLICY_MONIT=ASN\u7B56\u7565\u76D1\u6D4B +p2p_monit=P2P\u76D1\u6D4B \ No newline at end of file diff --git a/src/main/resources/sql/20180917/update_statistics_tables.sql b/src/main/resources/sql/20180917/update_statistics_tables.sql index 65779c597..35e21cab0 100644 --- a/src/main/resources/sql/20180917/update_statistics_tables.sql +++ b/src/main/resources/sql/20180917/update_statistics_tables.sql @@ -1,15 +1,16 @@ +ALTER EVENT event_exec_proc_config ON COMPLETION PRESERVE DISABLE; + ALTER TABLE cfg_num_statistics ADD COLUMN statistic_time datetime NULL COMMENT '统计时间'; ALTER TABLE request_num_statistics ADD COLUMN statistic_time datetime NULL COMMENT '统计时间'; update cfg_num_statistics set cfg_type=0; ALTER TABLE cfg_num_statistics CHANGE cfg_type compile_id int null default 0; ALTER TABLE request_num_statistics add compile_id int null default 0; -ALTER TABLE cfg_num_statistics add statistic_time datetime null default null; -ALTER TABLE request_num_statistics add statistic_time datetime null default null; + delete from statistics_tables; -INSERT INTO statistics_tables; +INSERT INTO statistics_tables () VALUES - (1, 'app_byte_cfg', 1, ''); + (1, 'app_byte_cfg', 0, ''); INSERT INTO statistics_tables () @@ -224,7 +225,7 @@ VALUES INSERT INTO statistics_tables () VALUES - (44, 'app_session_cfg', 1, ''); + (44, 'app_session_cfg', 0, ''); INSERT INTO statistics_tables () @@ -251,5 +252,196 @@ INSERT INTO statistics_tables VALUES (49, 'proxy_file_strategy_cfg', 1, ''); +drop PROCEDURE proc_statistics_config; +drop PROCEDURE proc_statistics_request; +-- ---------------------------- +-- Procedure structure for proc_statistics_config +-- ---------------------------- +DELIMITER ;; +CREATE DEFINER=`root`@`%` PROCEDURE `proc_statistics_config`() +BEGIN + + DECLARE ntime VARCHAR(40);/*当前时间*/ + + DECLARE tabName VARCHAR(500); + + DECLARE description VARCHAR(500); + + DECLARE deleteSql VARCHAR(500); + + DECLARE done INT;/*游标标识*/ + + DECLARE flag INT;/*循环标识*/ + + DECLARE proc_log_table VARCHAR(100);/*存储过程日志表*/ + + DECLARE proc_name VARCHAR(100);/*存储过程名称*/ + + DECLARE icursor CURSOR FOR SELECT tab_name FROM statistics_tables where is_valid=1; + + DECLARE CONTINUE HANDLER FOR NOT found SET done=1; + + DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK; + + SET done=0; + + SET proc_log_table='proc_exec_log'; + + SET proc_name='proc_statistics_config'; + + SET ntime=DATE_FORMAT(SYSDATE(),'%Y-%m-%d %H:%k:%S'); + + set @deleteSql := 'delete from cfg_num_statistics'; + + PREPARE execs FROM @deleteSql; + + EXECUTE execs; + + DEALLOCATE PREPARE execs; + + COMMIT; + + OPEN icursor; + + loop_iloop:LOOP + + FETCH icursor INTO tabName; + + SET description=tabName; + + set @descriptionStart=concat(description,'表统计start'); + + /*统计当前配置表数据到统计表中start*/ + + set @v_log_sql1 := concat('insert into ',proc_log_table,'(proc_name,table_name,log_time,description) values(?,?,?,?)'); + + PREPARE execs FROM @v_log_sql1; + + EXECUTE execs using proc_name,proc_log_table,ntime,@descriptionStart; + + DEALLOCATE PREPARE execs; + + COMMIT; + + set @insert_statistics_sql :=concat('insert into cfg_num_statistics(statistic_time,function_id,service_id,action,compile_id,cfg_state) select now(),function_id,service_id,action,compile_id,if(is_audit=3,3,if(is_audit=2,2,if(is_audit=1,1,if(is_valid=0,0,if(is_valid,-1,-1))))) cfg_state from ',tabName); + + PREPARE execs FROM @insert_statistics_sql; + + EXECUTE execs; + + DEALLOCATE PREPARE execs; + + COMMIT; + + + + set @descriptionEnd=concat(description,'表统计end'); + + set @v_log_sql2 := concat('insert into ',proc_log_table,'(proc_name,table_name,log_time,description) values(?,?,?,?)'); + + PREPARE execs FROM @v_log_sql2; + + EXECUTE execs using proc_name,proc_log_table,ntime,@descriptionEnd; + + DEALLOCATE PREPARE execs; + + COMMIT; + + + + /*统计当前配置表数据到统计表中end*/ + + IF done=1 THEN + + LEAVE loop_iloop; + + ELSE + + SET flag=0; + + END IF; + + IF flag=0 THEN + + SET done=0; + + END IF; + + END LOOP; + + CLOSE icursor; + + COMMIT; + +END;; +DELIMITER ; + +-- ---------------------------- +-- Procedure structure for proc_statistics_request +-- ---------------------------- +DELIMITER ;; +CREATE DEFINER=`root`@`%` PROCEDURE `proc_statistics_request`() +BEGIN + DECLARE ntime VARCHAR(40);/*当前时间*/ + DECLARE tabName VARCHAR(500); + DECLARE description VARCHAR(500); + DECLARE deleteSql VARCHAR(500); + DECLARE done INT;/*游标标识*/ + DECLARE flag INT;/*循环标识*/ + DECLARE proc_log_table VARCHAR(100);/*存储过程日志表*/ + DECLARE proc_name VARCHAR(100);/*存储过程名称*/ + DECLARE icursor CURSOR FOR SELECT tab_name FROM statistics_tables where is_valid=1; + DECLARE CONTINUE HANDLER FOR NOT found SET done=1; + DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK; + SET done=0; + SET proc_log_table='proc_exec_log'; + SET proc_name='proc_statistics_request'; + SET ntime=DATE_FORMAT(SYSDATE(),'%Y-%m-%d %H:%k:%S'); + set @deleteSql := 'delete from request_num_statistics'; + PREPARE execs FROM @deleteSql; + EXECUTE execs; + DEALLOCATE PREPARE execs; + COMMIT; + OPEN icursor; + loop_iloop:LOOP + FETCH icursor INTO tabName; + SET description=tabName; + set @descriptionStart=concat(description,'表request统计start'); + /*统计当前配置表数据到统计表中start*/ + set @v_log_sql1 := concat('insert into ',proc_log_table,'(proc_name,table_name,log_time,description) values(?,?,?,?)'); + PREPARE execs FROM @v_log_sql1; + EXECUTE execs using proc_name,proc_log_table,ntime,@descriptionStart; + DEALLOCATE PREPARE execs; + COMMIT; + + set @insert_statistics_sql :=concat('insert into request_num_statistics(statistic_time,function_id,service_id,request_id,compile_id) select now(),function_id,service_id,request_id,compile_id from ',tabName,' where request_id <> 0 and is_valid <> -1 and is_audit <> 3'); + PREPARE execs FROM @insert_statistics_sql; + EXECUTE execs; + DEALLOCATE PREPARE execs; + COMMIT; + + set @descriptionEnd=concat(description,'表request统计end'); + set @v_log_sql2 := concat('insert into ',proc_log_table,'(proc_name,table_name,log_time,description) values(?,?,?,?)'); + PREPARE execs FROM @v_log_sql2; + EXECUTE execs using proc_name,proc_log_table,ntime,@descriptionEnd; + DEALLOCATE PREPARE execs; + COMMIT; + + /*统计当前配置表数据到统计表中end*/ + IF done=1 THEN + LEAVE loop_iloop; + ELSE + SET flag=0; + END IF; + IF flag=0 THEN + SET done=0; + END IF; + END LOOP; + CLOSE icursor; + COMMIT; +END;; +DELIMITER ; + +ALTER EVENT event_exec_proc_config ON COMPLETION PRESERVE DISABLE; diff --git a/src/main/resources/sql/20180919/update_service_asn.sql b/src/main/resources/sql/20180919/update_service_asn.sql new file mode 100644 index 000000000..717592fc6 --- /dev/null +++ b/src/main/resources/sql/20180919/update_service_asn.sql @@ -0,0 +1,2 @@ +delete from function_service_dict where dict_id=117; +UPDATE function_service_dict set service_name='ANS_POLICY_MONIT',SERVICE_DESC='ANS_POLICY_MONIT' where dict_id=119; \ No newline at end of file