验证中...
RWAnalysis
Raw Copy
clc
clear all
trace_filename='./trace/Fin1'; %配置分析的trace 文件
[req_arrive,device_num,req_sec_start,req_sec_size,req_type]=textread(trace_filename,'%f%d%d%d%d');
%读取trace文件中的五个参数(请求到达时间,设备号,请求扇区号起始位置,请求扇区大小,请求操作类型(0表示写请求,1读请求))
all_req_sec_num=length(req_sec_start);
show_cycle_count=10000;
RW_ratio_list=[]; %R/W
Read_Count=0;
Count=1;
for index=1:all_req_sec_num
if Count<show_cycle_count
Count=Count+1;
if req_type(index)==1
Read_Count=Read_Count+1;
end
else
Count=1;
temp_ratio=Read_Count/show_cycle_count;
RW_ratio_list=[RW_ratio_list(1:end),temp_ratio];
Read_Count=0;
end
end
plot(RW_ratio_list)

Comment list( 0 )

You need to Sign in for post a comment

Help Search

183227_9af5e6a8_1826025 111910_4d91f001_1826025