--- 抽样产品 100040 在 2010-08-04 下 操作小于 30秒的 用户具体操作
再次 脚本上 修改 抽样 大于 30 秒 到 10 分钟
发现 这些用户 行为有明显 不同
cat /data/tongji/iphone_app/imusic/app*/2010/08/04/* |grep ab=100044| perl -nle ‘
BEGIN{
# print &diffTime("2009-12-04 16:58:38","2009-12-04 16:58:00");
sub diffTime{
use Time::Local;
my($st1,$st2) = @_;
my $t1=timelocal($6,$5,$4,$3,$2-1,$1-1900) if $st1=~/(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})/;
my $t2=timelocal($6,$5,$4,$3,$2-1,$1-1900) if $st2=~/(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})/;
return $t1-$t2;
}
}
my %m = {} ;
map{ $m{$1}=$2 if /(.*)=(.*)/ } split /<\|>/ ;
$u{ $m{auid} }{ $m{at} }="登入\t$m{wv} $m{abt}" if $m{aop} eq "a" ;
$u{ $m{auid} }{ $m{at} }="浏览\t$m{bn} $m{pmn}" if $m{aop} eq "be" ;
$u{ $m{auid} }{ $m{at} }="栏目\t$m{bn} $m{pmn}" if $m{aop} eq "bl" ;
$u{ $m{auid} }{ $m{at} }="下载\t$m{bn} $m{pmn}" if $m{aop} eq "dd" ;
my $stt = $h{ $m{auid} }{ $m{asid} }{ start } ;
$h{ $m{auid} }{ $m{asid} }{ start } = $m{at} if not $stt or $stt gt $m{at} ;
my $edt = $h{ $m{auid} }{ $m{asid} }{ end } ;
$h{ $m{auid} }{ $m{asid} }{ end } = $m{at} if not $edt or $edt lt $m{at} ;
END{
my $all = 0 ;
my $x30 = 0 ;
foreach my $auid(keys %h){
my $allt = 0 ;
$all ++ ;
foreach my $asid (keys %{$h{$auid}}){
my $st = $h{$auid}{$asid}{ start };
my $et = $h{$auid}{$asid}{ end };
$allt += &diffTime($et, $st);
}
if($allt < 30 ){
print "\n\n\n 用户 $auid 用户时 $allt 秒" ;
foreach $at (sort keys %{$u{$auid}}){
print "$at\t$u{$auid}{$at}";
}
}
}
}
' > /tmp/pop.lt.30s.txt
|
阅读(660) | 评论(0) | 转发(0) |