<?php
require_once("iecho.php");

$nvfile="d:/union_2.log";
$data=file_get_contents ( $nvfile );

$reg = "#/users/([^/]+)/.+ HTTP/1\..\" 200 ([0-9]+)#im";
preg_match_all($reg,$data,$matches);
foreach$matches[1as $key=>$file )
{
    
$rows[$file]['cnt']++;
    
$rows[$file]['size']=$matches[2][$key];
}
arsort($rows);

$i=0;
$t = 0;
foreach$rows as $file=>$row )
{
    
$size = $row['cnt']*$row['size'];
    
$r[$file= getMbps($size);
    
    
$i++;
    
if$i>15 )
        
break;
    
$t+=$size;
}

echo getMbps($t);

pr(
$r);

//prt($matches);

function getMbps($bytes)
{
    
return 8*($bytes/(1024*1024))/(15*60. "Mbps";    
}


?>

相关文章:

  • 2022-12-23
  • 2021-05-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2022-01-26
  • 2022-12-23
  • 2022-01-01
猜你喜欢
  • 2021-04-02
  • 2022-03-03
  • 2021-10-03
  • 2021-11-27
  • 2021-11-23
相关资源
相似解决方案