From: eldy <> Date: Sat, 4 Aug 2001 02:04:14 +0000 (+0000) Subject: Speed seriously increased when browsing main page for large site. X-Git-Tag: AWSTATS_1_0~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=554fb5322dcc3ea81c2f1e04537fefafa86cfe07;p=thirdparty%2FAWStats.git Speed seriously increased when browsing main page for large site. Memory used seriously reduced. --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 4fe45471..3c8bd767 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -2175,7 +2175,7 @@ if ($UpdateStats) { &UnescapeURLParam($param); # Change [ xxx=cache:www/zzz+aaa+bbb/ccc+ddd%20eee'fff ] into [ xxx=cache:www/zzz aaa bbb/ccc ddd eee fff ] # Ok, "xxx=cache:www/zzz aaa bbb/ccc ddd eee fff" is a search parameter line $param =~ s/.*=//; # Cut "xxx=" - $param =~ s/^cache:[^ +]* //; + $param =~ s/^cache:[^ ]* //; $param =~ s/^related:[^ ]* //; if ($SplitSearchString) { @wordlist=split(/ /,$param); # Split aaa bbb ccc ddd eee fff into a wordlist array @@ -2193,13 +2193,13 @@ if ($UpdateStats) { } else { # Search engine with unknown URL syntax foreach $param (@paramlist) { - &UnescapeURLParam($param); # Change [ xxx=cache:www+aaa+bbb/ccc+ddd%20eee'fff ] into [ xxx=cache:www aaa bbb ccc ddd eee fff ] + &UnescapeURLParam($param); # Change [ xxx=cache:www/zzz+aaa+bbb/ccc+ddd%20eee'fff ] into [ xxx=cache:www/zzz aaa bbb/ccc ddd eee fff ] $keep=1; foreach $paramtoexclude (@WordsToCleanSearchUrl) { if ($param =~ /.*$paramtoexclude.*/) { $keep=0; last; } # Not the param with search criteria } if ($keep == 0) { next; } # Do not keep this URL parameter because is in exclude list - # Ok, "xxx=cache:www aaa bbb ccc ddd eee fff" is a search parameter line + # Ok, "xxx=cache:www/zzz aaa bbb/ccc ddd eee fff" is a search parameter line $param =~ s/.*=//; # Cut "xxx=" $param =~ s/^cache:[^ ]* //; $param =~ s/^related:[^ ]* //; @@ -2337,8 +2337,82 @@ for ($ix=12; $ix>=1; $ix--) { #--------------------------------------------------------------------- -# SHOW STATISTICS +# SHOW REPORT #--------------------------------------------------------------------- + +# Get the tooltips texts +&Read_Language_Tooltip($Lang); + +# Position .style.pixelLeft/.pixelHeight/.pixelWidth/.pixelTop IE OK Opera OK +# .style.left/.height/.width/.top Netscape OK +# document.getElementById IE OK Opera OK Netscape OK +# document.body.offsetWidth|document.body.style.pixelWidth IE OK Opera OK Netscape OK Visible width of container +# document.body.scrollTop IE OK Opera OK Netscape OK Visible width of container +# tooltip.offsetWidth|tooltipOBJ.style.pixelWidth IE OK Opera OK Netscape OK Width of an object +# event.clientXY IE OK Opera OK Netscape KO Return position of mouse +print < + function ShowTooltip(fArg) + { + var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']"); + if (tooltipOBJ != null) { + var tooltipLft = (document.body.offsetWidth?document.body.offsetWidth:document.body.style.pixelWidth) - (tooltipOBJ.offsetWidth?tooltipOBJ.offsetWidth:(tooltipOBJ.style.pixelWidth?tooltipOBJ.style.pixelWidth:300)) - 30; + if (navigator.appName != 'Netscape') { + var tooltipTop = (document.body.scrollTop>=0?document.body.scrollTop+10:event.clientY+10); + if ((event.clientX > tooltipLft) && (event.clientY < (tooltipOBJ.scrollHeight?tooltipOBJ.scrollHeight:tooltipOBJ.style.pixelHeight) + 10)) { + tooltipTop = (document.body.scrollTop?document.body.scrollTop:document.body.offsetTop) + event.clientY + 20; + } + tooltipOBJ.style.pixelLeft = tooltipLft; tooltipOBJ.style.pixelTop = tooltipTop; + } + else { + var tooltipTop = 10; + tooltipOBJ.style.left = tooltipLft; tooltipOBJ.style.top = tooltipTop; + } + tooltipOBJ.style.visibility = "visible"; + } + } + function HideTooltip(fArg) + { + var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']"); + if (tooltipOBJ != null) { + tooltipOBJ.style.visibility = "hidden"; + } + } + +EOF + + +# MENU +#--------------------------------------------------------------------- +print "$CENTER
"; +print ""; +print ""; +print "\n"; +print "\n"; +print ""; +print "\n"; +print ""; +print "\n"; +print ""; +print "\n"; +print ""; +print "\n"; +print "
$message[7] : $SiteToAnalyze
$message[35] : "; +print ""; +my $choosedkey; +foreach $key (sort keys %LastUpdate) { if ($LastUpdate < $LastUpdate{$key}) { $choosedkey=$key; $LastUpdate = $LastUpdate{$key}; } } +$yearcon=substr($LastUpdate,0,4);$monthcon=substr($LastUpdate,4,2);$daycon=substr($LastUpdate,6,2);$hourcon=substr($LastUpdate,8,2);$mincon=substr($LastUpdate,10,2); +if ($LastUpdate != 0) { print "$daycon $monthlib{$monthcon} $yearcon - $hourcon:$mincon  "; } +else { print "Never updated"; } +print "       "; +if ($AllowToUpdateStatsFromBrowser) { print "$message[74]"; } +if ($UpdateStats) { print "
Lines in file: $NbOfLinesRead, found $NbOfNewLinesProcessed new records, $NbOfNewLinesCorrupted corrupted records"; } +else { print "
Lines in file: $LastUpdateLinesRead{$choosedkey}, found $LastUpdateNewLinesRead{$choosedkey} new records, $LastUpdateNewLinesCorrupted{$choosedkey} corrupted records"; } +print "
 
$message[16] : $message[17]   ".ucfirst($message[26])."   $message[53]   $message[20]   $message[45]
$message[72] : $message[19]   $message[21]   $message[59]   $message[33]   $message[34]
$message[23] : $message[37]   $message[24]
$message[2] : $message[22]   $message[31]
\n"; +print "
\n\n"; + + + if ($QueryString =~ /action=unknownip/i) { print "$CENTER
"; $tab_titre=$message[45]; @@ -2489,84 +2563,6 @@ if ($QueryString =~ /action=info/i) { @sorterrors=sort { $SortDir*$_errors_h{$a} <=> $SortDir*$_errors_h{$b} } keys (%_errors_h); &debug("End of sorting hash arrays"); -# Get the tooltips texts -&Read_Language_Tooltip($Lang); - -# Position .style.pixelLeft/.pixelHeight/.pixelWidth/.pixelTop IE OK Opera OK -# .style.left/.height/.width/.top Netscape OK -# document.getElementById IE OK Opera OK Netscape OK -# document.body.offsetWidth|document.body.style.pixelWidth IE OK Opera OK Netscape OK Visible width of container -# document.body.scrollTop IE OK Opera OK Netscape OK Visible width of container -# tooltip.offsetWidth|tooltipOBJ.style.pixelWidth IE OK Opera OK Netscape OK Width of an object -# event.clientXY IE OK Opera OK Netscape KO Return position of mouse -print < - function ShowTooltip(fArg) - { - var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']"); - if (tooltipOBJ != null) { - var tooltipLft = (document.body.offsetWidth?document.body.offsetWidth:document.body.style.pixelWidth) - (tooltipOBJ.offsetWidth?tooltipOBJ.offsetWidth:(tooltipOBJ.style.pixelWidth?tooltipOBJ.style.pixelWidth:300)) - 30; - if (navigator.appName != 'Netscape') { - var tooltipTop = (document.body.scrollTop>=0?document.body.scrollTop+10:event.clientY+10); - if ((event.clientX > tooltipLft) && (event.clientY < (tooltipOBJ.scrollHeight?tooltipOBJ.scrollHeight:tooltipOBJ.style.pixelHeight) + 10)) { - tooltipTop = (document.body.scrollTop?document.body.scrollTop:document.body.offsetTop) + event.clientY + 20; - } - tooltipOBJ.style.pixelLeft = tooltipLft; tooltipOBJ.style.pixelTop = tooltipTop; - } - else { - var tooltipTop = 10; - tooltipOBJ.style.left = tooltipLft; tooltipOBJ.style.top = tooltipTop; - } - tooltipOBJ.style.visibility = "visible"; - } - } - function HideTooltip(fArg) - { - var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']"); - if (tooltipOBJ != null) { - tooltipOBJ.style.visibility = "hidden"; - } - } - - -EOF - - -# MENU -#--------------------------------------------------------------------- -print "$CENTER
"; - -print ""; -print ""; -print "\n"; -print "\n"; -print ""; -print "\n"; -print ""; -print "\n"; -print ""; -print "\n"; -print ""; -print "\n"; -print "
$message[7]: $SiteToAnalyze
$message[35]: "; -foreach $key (keys %LastUpdate) { if ($LastUpdate < $LastUpdate{$key}) { $choosedkey=$key; $LastUpdate = $LastUpdate{$key}; } } -$yearcon=substr($LastUpdate,0,4);$monthcon=substr($LastUpdate,4,2);$daycon=substr($LastUpdate,6,2);$hourcon=substr($LastUpdate,8,2);$mincon=substr($LastUpdate,10,2); -if ($LastUpdate != 0) { print "$daycon $monthlib{$monthcon} $yearcon - $hourcon:$mincon  "; } -else { print "Never updated"; } -print "       "; -#if ($UpdateStats) { -# print " (New lines processed: $NbOfNewLinesProcessed, New lines corrupted: $NbOfNewLinesCorrupted)"; -#} -#else { -# print " (New lines processed: $LastUpdateNewLinesRead{$choosedkey}, New lines corrupted: $LastUpdateNewLinesCorrupted{$choosedkey})"; -#} -if ($AllowToUpdateStatsFromBrowser) { -# print "
 "; - print "$message[74]"; -} -print "
 
$message[16]:$message[17]   ".ucfirst($message[26])."   $message[53]   $message[20]   $message[45]
$message[72]:$message[19]   $message[21]   $message[59]   $message[33]   $message[34]
$message[23]:$message[37]   $message[24]
$message[2]: $message[22]   $message[31]
\n"; -print "
\n\n"; - # SUMMARY #---------------------------------------------------------------------