diff options
| author | 陈冠林 <[email protected]> | 2019-06-18 10:44:20 +0800 |
|---|---|---|
| committer | 陈冠林 <[email protected]> | 2019-06-18 10:44:20 +0800 |
| commit | b2a2f39d89b3bd154da10eb619f8a40c7c6b15d2 (patch) | |
| tree | b7a7d489030cfcc3b2fa878520d8c5d42dc5fce6 /src/rssb_statistics/all_len_st.py | |
| parent | b026525362d7f3b0ad58fb74362bf7f95ab515e8 (diff) | |
Diffstat (limited to 'src/rssb_statistics/all_len_st.py')
| -rw-r--r-- | src/rssb_statistics/all_len_st.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/rssb_statistics/all_len_st.py b/src/rssb_statistics/all_len_st.py new file mode 100644 index 0000000..6e32518 --- /dev/null +++ b/src/rssb_statistics/all_len_st.py @@ -0,0 +1,17 @@ +import os +import re +import csv +import bisect +# cmd1 = "cat survey.log.2018* | grep \"recv survey\" > survey.recv_survey.log" +# cmd2 = "cat media_expire.log.2018* > media_expire.log" +# os.system(cmd1) +# os.system(cmd2) +breakpoints = [1048576,1310720,1572864,1835008,2097152,3145728,4194304] +st_num = [0,0,0,0,0,0,0,0] + +with open("media_expire.log",'r') as infile: + for line in infile: + line_result = re.split(r",|MID:|media_len:",line) + j = bisect.bisect(breakpoints,int(line_result[6])) + st_num[j]+=1 +print st_num
\ No newline at end of file |
