from BoostKit_KSML.hdd_slow_detect import slow_detect
slow_detect('slow_test.data', 'result.data')
执行后脚本报错
python3 slow_detect_test.py
Traceback (most recent call last):
File "slow_detect_test.py", line 4, in <module>
slow_detect('slow_test.data', 'result.data')
File "src/oe2003/hdd/hdd_slow_detect.py", line 146, in hdd_slow_detect.args_check.wrapper
File "src/oe2003/hdd/hdd_slow_detect.py", line 153, in hdd_slow_detect.slow_detect
File "src/oe2003/hdd/hdd_slow_detect.py", line 215, in hdd_slow_detect.model_training
File "src/oe2003/hdd/hdd_slow_detect.py", line 235, in hdd_slow_detect.get_slow_disk_detect_train_model
File "<__array_function__ internals>", line 6, in percentile
File "/usr/local/lib64/python3.7/site-packages/numpy/lib/function_base.py", line 3868, in percentile
a, q, axis, out, overwrite_input, interpolation, keepdims)
File "/usr/local/lib64/python3.7/site-packages/numpy/lib/function_base.py", line 3988, in _quantile_unchecked
interpolation=interpolation)
File "/usr/local/lib64/python3.7/site-packages/numpy/lib/function_base.py", line 3564, in _ureduce
r = func(a, **kwargs)
File "/usr/local/lib64/python3.7/site-packages/numpy/lib/function_base.py", line 4098, in _quantile_ureduce_func
n = np.isnan(ap[-1])
IndexError: index -1 is out of bounds for axis 0 with size 0
我按照文档,调用iostat命令为/dev/sdc磁盘准备了120条数据,格式如下
其它参数都使用默认值,测试代码如下
from BoostKit_KSML.hdd_slow_detect import slow_detect slow_detect('slow_test.data', 'result.data')执行后脚本报错
python3 slow_detect_test.py Traceback (most recent call last): File "slow_detect_test.py", line 4, in <module> slow_detect('slow_test.data', 'result.data') File "src/oe2003/hdd/hdd_slow_detect.py", line 146, in hdd_slow_detect.args_check.wrapper File "src/oe2003/hdd/hdd_slow_detect.py", line 153, in hdd_slow_detect.slow_detect File "src/oe2003/hdd/hdd_slow_detect.py", line 215, in hdd_slow_detect.model_training File "src/oe2003/hdd/hdd_slow_detect.py", line 235, in hdd_slow_detect.get_slow_disk_detect_train_model File "<__array_function__ internals>", line 6, in percentile File "/usr/local/lib64/python3.7/site-packages/numpy/lib/function_base.py", line 3868, in percentile a, q, axis, out, overwrite_input, interpolation, keepdims) File "/usr/local/lib64/python3.7/site-packages/numpy/lib/function_base.py", line 3988, in _quantile_unchecked interpolation=interpolation) File "/usr/local/lib64/python3.7/site-packages/numpy/lib/function_base.py", line 3564, in _ureduce r = func(a, **kwargs) File "/usr/local/lib64/python3.7/site-packages/numpy/lib/function_base.py", line 4098, in _quantile_ureduce_func n = np.isnan(ap[-1]) IndexError: index -1 is out of bounds for axis 0 with size 0依赖包版本和文档描述的完全一致,是否能提供可以跑通的数据样例,另外数据输入参数应该怎么填写?比如检测当前磁盘是否为慢盘,是获取5s内的一条数据作为输入参数吗?