From 9b83d98a9e85870974104da59c48055ed96f520d Mon Sep 17 00:00:00 2001 From: zhuofeng Date: Mon, 21 Oct 2024 17:03:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E4=BC=A0?= =?UTF-8?q?=E8=BF=9B=E6=9D=A5=E7=9A=84period=E7=9A=84=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E5=80=BC=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/python/sentryCollector/collect_plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sysSentry-1.0.2/src/python/sentryCollector/collect_plugin.py b/sysSentry-1.0.2/src/python/sentryCollector/collect_plugin.py index 53dddec..9495d8b 100644 --- a/sysSentry-1.0.2/src/python/sentryCollector/collect_plugin.py +++ b/sysSentry-1.0.2/src/python/sentryCollector/collect_plugin.py @@ -45,6 +45,9 @@ LIMIT_IOTYPE_LIST_LEN = 4 LIMIT_PERIOD_MIN_LEN = 1 LIMIT_PERIOD_MAX_LEN = 300 +# max_save +LIMIT_MAX_SAVE_LEN = 300 + # interface protocol class ClientProtocol(): IS_IOCOLLECT_VALID = 0 @@ -189,7 +192,7 @@ def inter_is_iocollect_valid(period, disk_list=None, stage=None): if not period or not isinstance(period, int): result['ret'] = ResultMessage.RESULT_NOT_PARAM return result - if period < LIMIT_PERIOD_MIN_LEN or period > LIMIT_PERIOD_MAX_LEN: + if period < LIMIT_PERIOD_MIN_LEN or period > LIMIT_PERIOD_MAX_LEN * LIMIT_MAX_SAVE_LEN: result['ret'] = ResultMessage.RESULT_INVALID_LENGTH return result @@ -246,7 +249,7 @@ def inter_get_io_data(period, disk_list, stage, iotype): if not isinstance(period, int): result['ret'] = ResultMessage.RESULT_NOT_PARAM return result - if period < LIMIT_PERIOD_MIN_LEN or period > LIMIT_PERIOD_MAX_LEN: + if period < LIMIT_PERIOD_MIN_LEN or period > LIMIT_PERIOD_MAX_LEN * LIMIT_MAX_SAVE_LEN: result['ret'] = ResultMessage.RESULT_INVALID_LENGTH return result -- Gitee