r96289 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96288‎ | r96289 | r96290 >
Date:17:33, 5 September 2011
Author:ezachte
Status:deferred
Tags:
Comment:
browser stats breakdown now also for html requests only
Modified paths:
  • /trunk/wikistats/squids/SquidReportArchive.pl (modified) (history)

Diff [purge]

Index: trunk/wikistats/squids/SquidReportArchive.pl
@@ -6,8 +6,8 @@
77 ez_lib_version (2) ;
88
99 # set defaults mainly for tests on local machine
10 -# default_argv "-m 201010 " ;
11 - default_argv "-c -q 2010Q4" ;
 10+ default_argv "-m 2011-07 " ;
 11+# default_argv "-c -q 2010Q4" ;
1212
1313 # to do: add text from http://wiki.squid-cache.org/SquidFaq/SquidLogs
1414 # ReportOrigin how to handle '!error <-> other
@@ -117,11 +117,13 @@
118118 $file_html_methods = "SquidReportMethods.htm" ;
119119 $file_html_origins = "SquidReportOrigins.htm" ;
120120 $file_html_opsys = "SquidReportOperatingSystems.htm" ;
 121+ $file_html_opsys_html = "SquidReportOperatingSystemsHtmlOnly.htm" ;
121122 $file_html_scripts = "SquidReportScripts.htm" ;
122123 $file_html_skins = "SquidReportSkins.htm" ;
123124 $file_html_requests = "SquidReportRequests.htm" ;
124125 $file_html_google = "SquidReportGoogle.htm" ;
125126 $file_html_clients = "SquidReportClients.htm" ;
 127+ $file_html_clients_html = "SquidReportClientsHtmlOnly.htm" ;
126128
127129 # names till 2010-07-01
128130 #
@@ -304,16 +306,6 @@
305307 # &WriteCsvCountriesTargets ;
306308 close "FILE_LOG" ;
307309
308 - if (-d "/a/squid")
309 - {
310 -# $cmd = "tar -cf $path_reports/$date_last\-csv.tar $path_reports_in/*.csv | bzip2 $path_reports/$date_last\-csv.tar" ;
311 -# print "cmd = '$cmd'\n" ;
312 -# `$cmd` ;
313 - $cmd = "tar -cf $path_reports/$reportmonth\-html.tar $path_reports/*.htm | bzip2 $path_reports/$reportmonth\-html.tar" ;
314 - print "cmd = '$cmd'\n" ;
315 - `$cmd` ;
316 - }
317 -
318310 print "\nReady\n\n" ;
319311 exit ;
320312
@@ -561,9 +553,10 @@
562554
563555 chomp ($line) ;
564556
 557+ $mimecat = '' ; # page/image/other
565558 if ($line =~ /^E/)
566559 {
567 - ($rectype, $engine, $count) = split (',', $line) ;
 560+ ($rectype, $engine, $count,$mimecat) = split (',', $line) ;
568561
569562 next if ($engine !~ /^Gecko/) && ($engine !~ /^AppleWebKit/) ;
570563
@@ -589,7 +582,11 @@
590583 }
591584 elsif ($line =~ /^G/)
592585 {
593 - ($rectype, $mobile, $group, $count, $perc) = split (',', $line) ;
 586+ if ($line =~ /,(?:page|image|other),/)
 587+ { ($rectype, $mobile, $group, $mimecat, $count, $perc) = split (',', $line) ; }
 588+ else
 589+ { ($rectype, $mobile, $group, $count, $perc) = split (',', $line) ; }
 590+
594591 $total_clientgroups {$mobile} += $count ;
595592
596593 $group =~ s/^KDDI.*$/KDDI/ ;
@@ -604,19 +601,38 @@
605602 $group =~ s/^PANTECH.*$/PanTech/i ;
606603 $group =~ s/^Palm_Pre/Palm Pre/i ;
607604 $clientgroups {"$mobile,$group"} += $count ;
 605+
 606+ if ($mimecat eq 'page')
 607+ {
 608+ $total_clientgroups_html_only {$mobile} += $count ;
 609+ $clientgroups_html_only {"$mobile,$group"} += $count ;
 610+ }
608611 }
609612 else
610613 {
611 - ($rectype, $client, $count, $perc) = split (',', $line) ;
 614+ if ($line =~ /,(?:page|image|other),/)
 615+ { ($rectype, $client, $mimecat, $count, $perc) = split (',', $line) ; }
 616+ else
 617+ { ($rectype, $client, $count, $perc) = split (',', $line) ; }
612618
613619 $total_clients += $count ;
 620+
614621 $client =~ s/_/./g ;
615622 $client =~ s/\.\./Other/g ;
616623 if ($client !=~ / \d/)
617624 { $client =~ s/\// / ; }
618625 if ($rectype eq "-") { $total_clients_non_mobile += $count ; }
619626 if ($rectype eq "M") { $total_clients_mobile += $count ; }
 627+
620628 $clients {"$rectype,$client"} += $count ;
 629+
 630+ if ($mimecat eq 'page')
 631+ {
 632+ $total_clients_html_only += $count ;
 633+ if ($rectype eq "-") { $total_clients_non_mobile_html_only += $count ; }
 634+ if ($rectype eq "M") { $total_clients_mobile_html_only += $count ; }
 635+ $clients_html_only {"$rectype,$client"} += $count ;
 636+ }
621637 }
622638 }
623639 close CSV_CLIENTS ;
@@ -820,8 +836,13 @@
821837 next if $line =~ /^:/ ; # csv header (not a comment)
822838
823839 chomp $line ;
824 - ($rectype, $os, $count, $perc) = split (',', $line) ;
825840
 841+ $mimecat = '' ;
 842+ if ($line !~ /,(?:page|image|other),/)
 843+ { ($rectype, $os, $count, $perc) = split (',', $line) ; }
 844+ else
 845+ { ($rectype, $os, $mimecat, $count, $perc) = split (',', $line) ; }
 846+
826847 next if $count !~ /^\d+$/ ; # -,Linux Gentoo,,2,0.00% (extra comma !)
827848
828849 $os =~ s/_/./g ;
@@ -838,6 +859,13 @@
839860 if ($rectype eq "M") { $total_opsys_mobile += $count ; }
840861
841862 $opsys {"$rectype,$os"} += $count ;
 863+
 864+ if ($mimecat eq 'page')
 865+ {
 866+ $opsys_html_only {"$rectype,$os"} += $count ;
 867+ if ($rectype eq "-") { $total_opsys_non_mobile_html_only += $count ; }
 868+ if ($rectype eq "M") { $total_opsys_mobile_html_only += $count ; }
 869+ }
842870 }
843871 }
844872
@@ -1738,28 +1766,41 @@
17391767
17401768 sub CalcPercentages
17411769 {
1742 - my $total_opsys = $total_opsys_mobile + $total_opsys_non_mobile ;
 1770+ my $total_opsys = $total_opsys_mobile + $total_opsys_non_mobile ;
 1771+ my $total_opsys_html_only = $total_opsys_mobile_html_only + $total_opsys_non_mobile_html_only ;
17431772 foreach $key (keys %opsys)
17441773 { $opsys_perc {$key} = sprintf ("%.2f",(100*$opsys {$key}/$total_opsys)) . "%" ; }
 1774+ foreach $key (keys %opsys_html_only)
 1775+ { $opsys_perc_html_only {$key} = sprintf ("%.2f",(100*$opsys_html_only {$key}/$total_opsys_html_only)) . "%" ; }
17451776
17461777 foreach $key (keys %clients)
17471778 { $clients_perc {$key} = sprintf ("%.2f",(100*$clients {$key}/$total_clients)) . "%" ; }
 1779+ foreach $key (keys %clients_html_only)
 1780+ { $clients_perc_html_only {$key} = sprintf ("%.2f",(100*$clients_html_only {$key}/$total_clients_html_only)) . "%" ; }
17481781
17491782 foreach $key (keys %clientgroups)
17501783 {
1751 - $perc = 100*$clientgroups {$key}/$total_clients ;
 1784+ $perc = 100*$clientgroups {$key}/$total_clients ;
 1785+ $perc_html_only = 100*$clientgroups_html_only {$key}/$total_clients_html_only ;
17521786 if ($key =~ /^M/)
17531787 { $perc_threshold = 0.005 ; }
17541788 else
17551789 { $perc_threshold = 0.02 ; }
17561790
17571791 if ($perc > $perc_threshold)
1758 - { $clientgroups_perc {$key} = sprintf ("%.2f",$perc) . "%" ; }
 1792+ {
 1793+ $clientgroups_perc {$key} = sprintf ("%.2f",$perc) . "%" ;
 1794+ $clientgroups_perc_html_only {$key} = sprintf ("%.2f",$perc_html_only) . "%" ;
 1795+ }
17591796 else
17601797 {
17611798 ($mobile,$group) = split (',', $key) ;
1762 - $clientgroups_other {$mobile} += $clientgroups {$key} ;
1763 - $clientgroups {$key} = 0 ;
 1799+
 1800+ $clientgroups_other {$mobile} += $clientgroups {$key} ;
 1801+ $clientgroups_other_html_only {$mobile} += $clientgroups_html_only {$key} ;
 1802+
 1803+ $clientgroups {$key} = 0 ;
 1804+ $clientgroups_html_only {$key} = 0 ;
17641805 }
17651806 }
17661807 }
@@ -1773,15 +1814,27 @@
17741815 foreach $key (keys %clientgroups)
17751816 { $clientgroups {$key} = &Normalize ($clientgroups {$key}) ; }
17761817
 1818+ foreach $key (keys %clientgroups_html_only)
 1819+ { $clientgroups_html_only {$key} = &Normalize ($clientgroups_html_only {$key}) ; }
 1820+
17771821 foreach $key (keys %clients)
17781822 { $clients {$key} = &Normalize ($clients {$key}) ; }
17791823
 1824+ foreach $key (keys %clients_html_only)
 1825+ { $clients_html_only {$key} = &Normalize ($clients_html_only {$key}) ; }
 1826+
17801827 foreach $key (keys %clientgroups_other)
17811828 { $clientgroups_other {$key} = &Normalize ($clientgroups_other {$key}) ; }
17821829
 1830+ foreach $key (keys %clientgroups_other_html_only)
 1831+ { $clientgroups_other_html_only {$key} = &Normalize ($clientgroups_other_html_only {$key}) ; }
 1832+
17831833 foreach $key (keys %total_clientgroups)
17841834 { $total_clientgroups {$key} = &Normalize ($total_clientgroups {$key}) ; }
17851835
 1836+ foreach $key (keys %total_clientgroups_html_only)
 1837+ { $total_clientgroups_html_only {$key} = &Normalize ($total_clientgroups_html_only {$key}) ; }
 1838+
17861839 foreach $key (keys %total_engines)
17871840 { $total_engines {$key} = &Normalize ($total_engines {$key}) ; }
17881841
@@ -1792,6 +1845,10 @@
17931846 $total_clients_mobile = &Normalize ($total_clients_mobile) ;
17941847 $total_clients_non_mobile = &Normalize ($total_clients_non_mobile) ;
17951848
 1849+ $total_clients_html_only = &Normalize ($total_clients_html_only) ;
 1850+ $total_clients_mobile_html_only = &Normalize ($total_clients_mobile_html_only) ;
 1851+ $total_clients_non_mobile_html_only = &Normalize ($total_clients_non_mobile_html_only) ;
 1852+
17961853 # ReadInputCrawlers
17971854 foreach $key (keys %crawlers)
17981855 { $crawlers {$key} = &Normalize ($crawlers {$key}) ; }
@@ -1958,6 +2015,7 @@
19592016
19602017 sub WriteReportClients
19612018 {
 2019+ print "\nWriteReportClients -> $path_reports/$file_html_clients\n\n" ;
19622020 open FILE_HTML_CLIENTS, '>', "$path_reports/$file_html_clients" ;
19632021
19642022 $html = $header ;
@@ -1975,27 +2033,34 @@
19762034 "</td></tr>\n" ;
19772035
19782036 # CLIENTS SORTED BY FREQUENCY
1979 - $html .= "<tr><td width=50% valign=top>" ;
 2037+ $html .= "<tr><td width=50% valign=top style='vertical-align:top'>" ;
19802038 $html .= "<table border=1 width=100%>\n" ;
19812039 $html .= "<tr><th colspan=99 class=l><h3>In order of popularity</h3></th></tr>\n" ;
19822040
1983 - $html .= "<tr><th colspan=99 class=l>&nbsp;<br>Browsers, non mobile</th></tr>\n" ;
 2041+ # CLIENTS SORTED BY FREQUENCY, BROWSERS, NON MOBILE
 2042+ $html .= "<tr><th class=l>&nbsp;<br>Browsers, non mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
19842043 $perc_total = 0 ;
 2044+ $perc_total_html_only = 0 ;
19852045 foreach $key (@clientgroups_sorted_count)
19862046 {
19872047 $count = $clientgroups {$key} ;
1988 -
19892048 next if $count == 0 ;
1990 -
19912049 $perc = $clientgroups_perc {$key} ;
19922050 ($mobile,$group) = split (',', $key) ;
1993 -
19942051 next if $mobile ne '-' ;
 2052+ $count = &FormatCount ($count) ;
19952053
1996 - $count = &FormatCount ($count) ;
1997 - $html .= "<tr><td class=l>$group</a></td><td class=r>$count</td><td class=r>$perc</td></tr>\n" ;
 2054+ $count_html_only = $clientgroups_html_only {$key} ;
 2055+ $perc_html_only = $clientgroups_perc_html_only {$key} ;
 2056+ $count_html_only = &FormatCount ($count_html_only) ;
 2057+
 2058+ $html .= "<tr><td class=l>$group</a></td><td class=r>$count</td><td class=r>$perc</td><td class=r>$count_html_only</td><td class=r>$perc_html_only</td></tr>\n" ;
 2059+
19982060 $perc =~ s/\%// ;
 2061+ $perc_html_only =~ s/\%// ;
 2062+
19992063 $perc_total += $perc ;
 2064+ $perc_total_html_only += $perc_html_only ;
20002065 }
20012066
20022067 $perc = ".." ;
@@ -2005,104 +2070,146 @@
20062071 $perc = sprintf ("%.2f", 100 * $clientgroups_other {'-'} / ($total_clientgroups {'-'} + $total_clientgroups {'M'})) ;
20072072 $perc_total += $perc ;
20082073 }
2009 - $html .= "<tr><td class=l>Other</th><td class=r>$count</td><td class=r>$perc\%</td></tr>\n" ;
 2074+ $perc_html_only = ".." ;
 2075+ $count_html_only = $clientgroups_other_html_only {'-'} ;
 2076+ if ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'} > 0)
 2077+ {
 2078+ $perc_html_only = sprintf ("%.2f", 100 * $clientgroups_other_html_only {'-'} / ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'})) ;
 2079+ $perc_total_html_only += $perc_html_only ;
 2080+ }
20102081
 2082+ $html .= "<tr><td class=l>Other</th><td class=r>$count</td><td class=r>$perc\%</td><td class=r>$count_html_only</td><td class=r>$perc_html_only\%</td></tr>\n" ;
 2083+
20112084 $total = &FormatCount ($total_clientgroups {'-'}) ;
20122085 $perc_total = sprintf ("%.1f", $perc_total) ;
2013 - $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th></tr>\n" ;
20142086
2015 - $html .= "<tr><th colspan=99 class=l>&nbsp;<br>Browsers, mobile</th></tr>\n" ;
 2087+ $total_html_only = &FormatCount ($total_clientgroups_html_only {'-'}) ;
 2088+ $perc_total_html_only = sprintf ("%.1f", $perc_total_html_only) ;
 2089+
 2090+ $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th><th class=r>$total_html_only</th><th class=r>$perc_total_html_only\%</th></tr>\n" ;
 2091+
 2092+ # CLIENTS SORTED BY FREQUENCY, BROWSERS, MOBILE
 2093+ $html .= "<tr><th class=l>&nbsp;<br>Browsers, mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
20162094 foreach $key (@clientgroups_sorted_count)
20172095 {
20182096 $count = $clientgroups {$key} ;
2019 -
20202097 next if $count == 0 ;
2021 -
20222098 $perc = $clientgroups_perc {$key} ;
20232099 ($mobile,$group) = split (',', $key) ;
2024 -
20252100 next if $mobile ne 'M' ;
 2101+ $count = &FormatCount ($count) ;
20262102
2027 - $count = &FormatCount ($count) ;
2028 - $html .= "<tr><td class=l>$group</a></td><td class=r>$count</td><td class=r>$perc</td></tr>\n" ;
 2103+ $count_html_only = $clientgroups_html_only {$key} ;
 2104+ $perc_html_only = $clientgroups_perc_html_only {$key} ;
 2105+ $count_html_only = &FormatCount ($count_html_only) ;
 2106+
 2107+ $html .= "<tr><td class=l>$group</a></td><td class=r>$count</td><td class=r>$perc</td><td class=r>$count_html_only</td><td class=r>$perc_html_only</td></tr>\n" ;
20292108 $perc =~ s/\%// ;
20302109 }
 2110+
20312111 $count = $clientgroups_other {'M'} ;
2032 -
20332112 $perc = ".." ;
20342113 if ($total_clientgroups {'-'} + $total_clientgroups {'M'} > 0)
20352114 { $perc = sprintf ("%.2f", 100 * $count / ($total_clientgroups {'-'} + $total_clientgroups {'M'})) ; }
20362115
 2116+ $count_html_only = $clientgroups_other_html_only {'M'} ;
 2117+ $perc_html_only = ".." ;
 2118+ if ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'} > 0)
 2119+ { $perc_html_only = sprintf ("%.2f", 100 * $count_html_only / ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'})) ; }
 2120+
20372121 $perc_total = sprintf ("%.1f", (100 - $perc_total)) ;
20382122 $total = &FormatCount ($total_clientgroups {'M'}) ;
2039 - $html .= "<tr><td class=l>Other</th><td class=r>$count</td><td class=r>$perc\%</td></tr>\n" ;
2040 - $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th></tr>\n" ;
20412123
2042 - $html .= "<tr><th colspan=99 class=l>&nbsp;<br>Browser versions, non mobile</th></tr>\n" ;
 2124+ $perc_total_html_only = sprintf ("%.1f", (100 - $perc_total_html_only)) ;
 2125+ $total_html_only = &FormatCount ($total_clientgroups_html_only {'M'}) ;
20432126
 2127+ $html .= "<tr><td class=l>Other</th><td class=r>$count</td><td class=r>$perc\%</td><td class=r>$count_html_only</td><td class=r>$perc_html_only\%</td></tr>\n" ;
 2128+ $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th><th class=r>$total_html_only</th><th class=r>$perc_total_html_only\%</th></tr>\n" ;
 2129+
 2130+ # CLIENTS SORTED BY FREQUENCY, BROWSER VERSIONS, NON MOBILE
 2131+ $html .= "<tr><th class=l>&nbsp;<br>Browser versions, non mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
 2132+
20442133 foreach $key (@clients_sorted_count)
20452134 {
20462135 $count = $clients {$key} ;
20472136 ($rectype, $client) = split (',', $key,2) ;
2048 -
20492137 next if $rectype ne '-' ; # group
2050 -
20512138 $perc = $clients_perc {$key} ;
2052 -
20532139 next if $perc lt "0.02%" ;
 2140+ $count = &FormatCount ($count) ;
20542141
2055 - $count = &FormatCount ($count) ;
2056 - $html .= "<tr><td class=l>$client</a></td><td class=r>$count</td><td class=r>$perc</td></tr>\n" ;
 2142+ $count_html_only = $clients_html_only {$key} ;
 2143+ $perc_html_only = $clients_perc_html_only {$key} ;
 2144+
 2145+ $html .= "<tr><td class=l>$client</a></td><td class=r>$count</td><td class=r>$perc</td><td class=r>$count_html_only</td><td class=r>$perc_html_only</td></tr>\n" ;
20572146 $perc =~ s/\%// ;
20582147 }
 2148+
20592149 $total = &FormatCount ($total_clients_non_mobile) ;
2060 -
20612150 $perc_total = sprintf ("%.1f", (100 - $perc_total)) ;
2062 - $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th></tr>\n" ;
20632151
2064 - $html .= "<tr><th colspan=99 class=l>&nbsp;<br>Browser versions, mobile</th></tr>\n" ;
 2152+ $total_html_only = &FormatCount ($total_clients_non_mobile_html_only) ;
 2153+ $perc_total_html_only = sprintf ("%.1f", (100 - $perc_total_html_only)) ;
 2154+
 2155+ $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th><th class=r>$total_html_only</th><th class=r>$perc_total_html_only\%</th></tr>\n" ;
 2156+
 2157+ # CLIENTS SORTED BY FREQUENCY, BROWSER VERSIONS, MOBILE
 2158+ $html .= "<tr><th class=l>&nbsp;<br>Browser versions, mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
20652159 foreach $key (@clients_sorted_count)
20662160 {
20672161 $count = $clients {$key} ;
20682162 ($rectype, $client) = split (',', $key,2) ;
2069 -
20702163 next if $rectype ne 'M' ; # group
2071 -
20722164 $perc = $clients_perc {$key} ;
2073 -
20742165 next if $perc lt "0.02%" ;
 2166+ $count = &FormatCount ($count) ;
20752167
2076 - $count = &FormatCount ($count) ;
2077 - $html .= "<tr><td class=l>$client</a></td><td class=r>$count</td><td class=r>$perc</td></tr>\n" ;
 2168+ $perc_html_only = $clients_perc_html_only {$key} ;
 2169+ $count_html_only = $clients_html_only {$key} ;
 2170+ $count_html_only = &FormatCount ($count_html_only) ;
 2171+
 2172+ $html .= "<tr><td class=l>$client</a></td><td class=r>$count</td><td class=r>$perc</td><td class=r>$count_html_only</td><td class=r>$perc_html_only</td></tr>\n" ;
20782173 }
 2174+
20792175 $total = &FormatCount ($total_clients_mobile) ;
20802176 $perc = sprintf ("%.1f", (100 - $perc_total)) ;
2081 - $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc\%</th></tr>\n" ;
20822177
 2178+ $total_html_only = &FormatCount ($total_clients_mobile_html_only) ;
 2179+ $perc_html_only = sprintf ("%.1f", (100 - $perc_total_html_only)) ;
 2180+
 2181+ $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc\%</th><th class=r>$total_html_only</th><th class=r>$perc_html_only\%</th></tr>\n" ;
 2182+
20832183 $html .= "</table>\n" ;
20842184
2085 - # CLIENTS In alphabetical order
 2185+ # CLIENTS IN ALPHABETHICAL ORDER
20862186 $html .= "</td><td width=50% valign=top>" ;
20872187 $html .= "<table border=1 width=100%>\n" ;
20882188 $html .= "<tr><th colspan=99 class=l><h3>In alphabetical order</h3></th></tr>\n" ;
20892189
2090 - $html .= "<tr><th colspan=99 class=l>&nbsp;<br>Browsers, non mobile</th></tr>\n" ;
 2190+ # CLIENTS IN ALPHABETHICAL ORDER, BROWSERS, NON MOBILE
 2191+ $html .= "<tr><th class=l>&nbsp;<br>Browsers, non mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
20912192 $perc_total = 0 ;
 2193+ $perc_total_html_only = 0 ;
20922194 foreach $key (@clientgroups_sorted_alpha)
20932195 {
20942196 $count = $clientgroups {$key} ;
2095 -
20962197 next if $count == 0 ;
2097 -
20982198 $perc = $clientgroups_perc {$key} ;
20992199 ($mobile,$group) = split (',', $key) ;
2100 -
21012200 next if $mobile ne '-' ;
 2201+ $count = &FormatCount ($count) ;
21022202
2103 - $count = &FormatCount ($count) ;
2104 - $html .= "<tr><td class=l>$group</a></td><td class=r>$count</td><td class=r>$perc</td></tr>\n" ;
 2203+ $count_html_only = $clientgroups_html_only {$key} ;
 2204+ $perc_html_only = $clientgroups_perc_html_only {$key} ;
 2205+ $count_html_only = &FormatCount ($count_html_only) ;
 2206+
 2207+ $html .= "<tr><td class=l>$group</a></td><td class=r>$count</td><td class=r>$perc</td><td class=r>$count_html_only</td><td class=r>$perc_html_only</td></tr>\n" ;
 2208+
21052209 $perc =~ s/\%// ;
21062210 $perc_total += $perc ;
 2211+
 2212+ $perc_html_only =~ s/\%// ;
 2213+ $perc_total_html_only += $perc_html_only ;
21072214 }
21082215
21092216 $count = $clientgroups_other {'-'} ;
@@ -2112,71 +2219,101 @@
21132220 { $perc = sprintf ("%.2f", 100 * $count / ($total_clientgroups {'-'} + $total_clientgroups {'M'})) ; }
21142221 $perc_total += $perc ;
21152222 $perc_total = sprintf ("%.1f", $perc_total) ;
2116 - $html .= "<tr><td class=l>Other</th><td class=r>$count</td><td class=r>$perc\%</td></tr>\n" ;
2117 - $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th></tr>\n" ;
21182223
2119 - $html .= "<tr><th colspan=99 class=l>&nbsp;<br>Browsers, mobile</th></tr>\n" ;
 2224+ $count_html_only = $clientgroups_other_html_only {'-'} ;
 2225+ $total_html_only = &FormatCount ($total_clientgroups_html_only {'-'}) ;
 2226+ $perc_html_only = ".." ;
 2227+ if ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'} > 0)
 2228+ { $perc_html_only = sprintf ("%.2f", 100 * $count_html_only / ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'})) ; }
 2229+ $perc_total_html_only += $perc_html_only ;
 2230+ $perc_total_html_only = sprintf ("%.1f", $perc_total_html_only) ;
 2231+
 2232+ $html .= "<tr><td class=l>Other</th><td class=r>$count</td><td class=r>$perc\%</td><td class=r>$count_html_only</td><td class=r>$perc_html_only\%</td></tr>\n" ;
 2233+ $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th><th class=r>$total_html_only</th><th class=r>$perc_total_html_only\%</th></tr>\n" ;
 2234+
 2235+ # CLIENTS IN ALPHABETHICAL ORDER, BROWSERS, MOBILE
 2236+ $html .= "<tr><th class=l>&nbsp;<br>Browsers, mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
21202237 foreach $key (@clientgroups_sorted_alpha)
21212238 {
21222239 $count = $clientgroups {$key} ;
2123 -
21242240 next if $count == 0 ;
2125 -
21262241 $perc = $clientgroups_perc {$key} ;
21272242 ($mobile,$group) = split (',', $key) ;
2128 -
21292243 next if $mobile ne 'M' ;
 2244+ $count = &FormatCount ($count) ;
21302245
2131 - $count = &FormatCount ($count) ;
2132 - $html .= "<tr><td class=l>$group</a></td><td class=r>$count</td><td class=r>$perc</td></tr>\n" ;
 2246+ $count_html_only = $clientgroups_html_only {$key} ;
 2247+ $perc_html_only = $clientgroups_perc_html_only {$key} ;
 2248+ $count_html_only = &FormatCount ($count_html_only) ;
 2249+
 2250+ $html .= "<tr><td class=l>$group</a></td><td class=r>$count</td><td class=r>$perc</td><td class=r>$count_html_only</td><td class=r>$perc_html_only</td></tr>\n" ;
21332251 $perc =~ s/\%// ;
21342252 }
 2253+
21352254 $count = $clientgroups_other {'M'} ;
21362255 $total = &FormatCount ($total_clientgroups {'M'}) ;
21372256 $perc = sprintf ("%.2f", 100 * $count / ($total_clientgroups {'-'} + $total_clientgroups {'M'})) ;
21382257 $perc_total = sprintf ("%.1f", (100 - $perc_total)) ;
2139 - $html .= "<tr><td class=l>Other</th><td class=r>$count</td><td class=r>$perc\%</td></tr>\n" ;
2140 - $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th></tr>\n" ;
21412258
2142 - $html .= "<tr><th colspan=99 class=l>&nbsp;<br>Browser versions, non mobile</th></tr>\n" ;
 2259+ $count_html_only = $clientgroups_other_html_only {'M'} ;
 2260+ $total_html_only = &FormatCount ($total_clientgroups_html_only {'M'}) ;
 2261+ $perc_html_only = sprintf ("%.2f", 100 * $count_html_only / ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'})) ;
 2262+ $perc_total_html_only = sprintf ("%.1f", (100 - $perc_total_html_only)) ;
21432263
 2264+ $html .= "<tr><td class=l>Other</th><td class=r>$count</td><td class=r>$perc\%</td><td class=r>$count_html_only</td><td class=r>$perc_html_only\%</td></tr>\n" ;
 2265+ $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total\%</th><th class=r>$total_html_only</th><th class=r>$perc_total_html_only\%</th></tr>\n" ;
 2266+
 2267+ # CLIENTS IN ALPHABETHICAL ORDER, BROWSER VERSIONS, NON MOBILE
 2268+ $html .= "<tr><th class=l>&nbsp;<br>Browser versions, non mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
 2269+
21442270 foreach $key (@clients_sorted_alpha)
21452271 {
21462272 $count = $clients {$key} ;
21472273 ($rectype, $client) = split (',', $key,2) ;
2148 -
21492274 next if $rectype ne '-' ; # group
2150 -
21512275 $perc = $clients_perc {$key} ;
2152 -
21532276 next if $perc lt "0.02%" ;
 2277+ $count = &FormatCount ($count) ;
21542278
2155 - $count = &FormatCount ($count) ;
2156 - $html .= "<tr><td class=l>$client</a></td><td class=r>$count</td><td class=r>$perc</td></tr>\n" ;
 2279+ $count_html_only = $clients_html_only {$key} ;
 2280+ $perc_html_only = $clients_perc_html_only {$key} ;
 2281+ $count_html_only = &FormatCount ($count_html_only) ;
 2282+
 2283+ $html .= "<tr><td class=l>$client</a></td><td class=r>$count</td><td class=r>$perc</td><td class=r>$count_html_only</td><td class=r>$perc_html_only</td></tr>\n" ;
21572284 }
21582285 $total = &FormatCount ($total_clients_non_mobile) ;
21592286 $perc = sprintf ("%.1f",100*$total_clients_non_mobile / ($total_clients_mobile + $total_clients_non_mobile)) ;
2160 - $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc\%</th></tr>\n" ;
21612287
2162 - $html .= "<tr><th colspan=99 class=l>&nbsp;<br>Browser versions, mobile</th></tr>\n" ;
 2288+ $total_html_only = &FormatCount ($total_clients_non_mobile_html_only) ;
 2289+ $perc_html_only = sprintf ("%.1f",100*$total_clients_non_mobile_html_only / ($total_clients_mobile_html_only + $total_clients_non_mobile_html_only)) ;
 2290+
 2291+ $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc\%</th><th class=r>$total_html_only</th><th class=r>$perc_html_only\%</th></tr>\n" ;
 2292+
 2293+ # CLIENTS IN ALPHABETHICAL ORDER, BROWSER VERSIONS, MOBILE
 2294+ $html .= "<tr><th class=l>&nbsp;<br>Browser versions, mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
21632295 foreach $key (@clients_sorted_alpha)
21642296 {
21652297 $count = $clients {$key} ;
21662298 ($rectype, $client) = split (',', $key,2) ;
2167 -
21682299 next if $rectype ne 'M' ; # group
2169 -
21702300 $perc = $clients_perc {$key} ;
2171 -
21722301 next if $perc lt "0.02%" ;
 2302+ $count = &FormatCount ($count) ;
21732303
2174 - $count = &FormatCount ($count) ;
2175 - $html .= "<tr><td class=l>$client</a></td><td class=r>$count</td><td class=r>$perc</td></tr>\n" ;
 2304+ $count_html_only = $clients_html_only {$key} ;
 2305+ $perc_html_only = $clients_perc_html_only {$key} ;
 2306+ $count_html_only = &FormatCount ($count_html_only) ;
 2307+
 2308+ $html .= "<tr><td class=l>$client</a></td><td class=r>$count</td><td class=r>$perc</td><td class=r>$count_html_only</td><td class=r>$perc_html_only</td></tr>\n" ;
21762309 }
21772310 $total = &FormatCount ($total_clients_mobile) ;
21782311 $perc = sprintf ("%.1f",100*$total_clients_mobile / ($total_clients_mobile + $total_clients_non_mobile)) ;
2179 - $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc\%</th></tr>\n" ;
21802312
 2313+ $total_html_only = &FormatCount ($total_clients_mobile_html_only) ;
 2314+ $perc_html_only = sprintf ("%.1f",100*$total_clients_mobile_html_only / ($total_clients_mobile_html_only + $total_clients_non_mobile_html_only)) ;
 2315+
 2316+ $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc\%</th><th class=r>$total_html_only</th><th class=r>$perc_html_only\%</th></tr>\n" ;
 2317+
21812318 $html .= "<tr><th colspan=99 class=l>&nbsp;<br>Browser engines</th></tr>\n" ;
21822319
21832320 $engine_prev = "" ;
@@ -4931,7 +5068,7 @@
49325069 # print "Convert world_map_$period.svg to gif\n" ;
49335070 # `svg/convert.exe svg/world_map_$period.svg gif:svg/world_map_$period.gif` ;
49345071
4935 -# exit ; # qqq
 5072+# exit ;
49365073 # exit ;
49375074 # sleep (2) ; # until computer fan fixed
49385075 }

Status & tagging log