HDD慢盘检测slow_detect函数如何使用
收藏回复举报
HDD慢盘检测slow_detect函数如何使用
t('forum.solved') 已解决
新人帖
发表于2024-07-16 18:25:09
0 查看

我按照文档,调用iostat命令为/dev/sdc磁盘准备了120条数据,格式如下

sdc 7.00 4.71 33.02 0.17 0.33 0.21 0.28 0.60 34.03 0.16 0.24 0.26 1.08 0.49 36.52 0.16 1.05 0.22 0.26 0.65 0.43 24.56 0.21 0.37 0.73 0.67 0.30 0.15 36.80 0.19 0.55 1.10 0.66 0.18 0.22 31.94 4.62 0.17 13.52 0.63 1.41 0.19 0.23 23.30 0.21 0.32 1.78 5.48 0.88 0.16 43.86 0.17 1.04 2.15 0.42 0.18 0.24 23.93 0.24 3.26 1.39 0.19 0.22 0.18 37.04 0.29 1.12 0.54 0.32 0.17 0.21 20.52 1.11 0.35 0.20 5.57 0.98 21.81 0.56 0.25 0.27 0.21 0.23 21.14 2.55 0.22 0.18 0.18 0.22 0.18 36.80 0.84 0.19 23.54 0.27 4.45 0.80 0.62 0.31 0.53 1.45 0.18 0.25 0.51 0.18 0.18 0.22 2.83 12.69 0.17 0.80 5.39 0.34 0.97 0.23 0.19 1.23 0.41 0.22 0.33

其它参数都使用默认值,测试代码如下

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内的一条数据作为输入参数吗?

python3.7.9
numpy1.21.6
scipy1.7.3
pandas1.3.5
scikit_learn1.0.2

我要发帖子