分析访问日志,qps

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

  1 #!/bin/bash                                                                      
  2 # @File:         qps.sh                                                          
  3 # @Aim:                                                                          
  4 # @Author:       Foyon                                                           
  5 # @Created Time: 2014-04-23                                                      
  6 file='/home/fanhy/log/22.log'                                                    
  7 for ((i=1398175200;i<1398261600;i++))                                            
  8 do                                                                               
  9     time=`date -d @$i "+%Y:%H:%M:%S"`                                            
 10     qps=`cat $file | grep $time | wc -l`                                         
 11     echo time:$time,qps:$qps                                                     
 12 done