处理的数据格式如图所示,主要是对blktrace抓取的磁盘信息进行处理。
0.001742812,30893,G,R,1180470464,16,[mapkeeper_rocks],1
0.001927242,30893,G,WS,800359816,16,[mapkeeper_rocks],4
0.002208006,30893,G,WS,800359824,8,[mapkeeper_rocks],1
0.002395960,30893,G,WS,800359824,8,[mapkeeper_rocks],1
0.002560709,30893,G,R,170181608,16,[mapkeeper_rocks],1
0.002771388,30893,G,WS,800359824,8,[mapkeeper_rocks],2
0.003061567,30893,G,R,549982936,16,[mapkeeper_rocks],1
0.003267269,30893,G,R,261945208,16,[mapkeeper_rocks],1
0.003524796,30893,G,WS,800359824,8,[mapkeeper_rocks],3
0.003692649,30893,G,R,647880544,16,[mapkeeper_rocks],1
0.003922432,30893,G,WS,800359824,8,[mapkeeper_rocks],4
0.004295463,30893,G,R,1036282136,16,[mapkeeper_rocks],1
0.004456723,30893,G,WS,800359824,8,[mapkeeper_rocks],5
0.004650597,30893,G,R,533219392,16,[mapkeeper_rocks],1
0.004879987,30893,G,WS,800359824,8,[mapkeeper_rocks],6
在这里第一列表示的是时间戳,设置时间窗口重新进行数据格式修改之后输入到模型进行训练,LSTM代码如下:
<