r113048 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113047‎ | r113048 | r113049 >
Date:17:22, 5 March 2012
Author:ezachte
Status:deferred
Tags:
Comment:
ReportClients, chg section headers for mobile apps + more permissive filter (show > 0.001%)
Modified paths:
  • /trunk/wikistats/squids/SquidReportArchive.pl (modified) (history)

Diff [purge]

Index: trunk/wikistats/squids/SquidReportArchive.pl
@@ -1856,13 +1856,16 @@
18571857 $perc_html_only = 100*$clientgroups_html_only {$key}/$total_clients_html_only ;
18581858 if ($key =~ /^M/)
18591859 { $perc_threshold = 0.005 ; }
 1860+ elsif ($key =~ /^W/)
 1861+ { $perc_threshold = 0.001 ; }
18601862 else
18611863 { $perc_threshold = 0.02 ; }
18621864
18631865 if ($perc > $perc_threshold)
18641866 {
1865 - $clientgroups_perc {$key} = sprintf ("%.2f",$perc) . "%" ;
1866 - $clientgroups_perc_html_only {$key} = sprintf ("%.2f",$perc_html_only) . "%" ;
 1867+ $precision = ($key =~ /^W/) ? "%.3f" : "%.2f" ;
 1868+ $clientgroups_perc {$key} = sprintf ($precision,$perc) . "%" ;
 1869+ $clientgroups_perc_html_only {$key} = sprintf ($precision,$perc_html_only) . "%" ;
18671870 }
18681871 else
18691872 {
@@ -2150,11 +2153,10 @@
21512154 }
21522155 $perc_html_only = ".." ;
21532156 $count_html_only = $clientgroups_other_html_only {'-'} ;
2154 - if ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'} +
2155 -$total_clientgroups_html_only {'W'} > 0)
 2157+ if ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'} + $total_clientgroups_html_only {'W'} > 0)
21562158 {
21572159 $perc_html_only = sprintf ("%.2f", 100 * $clientgroups_other_html_only {'-'} / ($total_clientgroups_html_only {'-'} + $total_clientgroups_html_only {'M'} +
2158 -$total_clientgroups_html_only {'W'})) ;
 2160+ $total_clientgroups_html_only {'W'})) ;
21592161 $perc_total_html_only_nonmobile += $perc_html_only ;
21602162 }
21612163
@@ -2213,7 +2215,7 @@
22142216 $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total_mobile\%</th><th class=r>$total_html_only</th><th class=r>$perc_total_html_only_mobile\%</th></tr>\n" ;
22152217
22162218 # CLIENTS SORTED BY FREQUENCY, BROWSERS, WIKIMOBILE
2217 - $html .= "<tr><th class=l>&nbsp;<br>Wiki applications, mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
 2219+ $html .= "<tr><th class=l>&nbsp;<br>Mobile applications</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
22182220 $perc_total_wiki = 0 ;
22192221 $perc_total_html_only_wiki = 0 ;
22202222
@@ -2290,7 +2292,7 @@
22912293 ($rectype, $client) = split (',', $key,2) ;
22922294 next if $rectype ne 'M' ; # group
22932295 $perc = $clients_perc {$key} ;
2294 - next if $perc lt "0.02%" ;
 2296+ next if $perc lt "0.005%" ;
22952297 $count = &FormatCount ($count) ;
22962298
22972299 $perc_html_only = $clients_perc_html_only {$key} ;
@@ -2309,14 +2311,14 @@
23102312 $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" ;
23112313
23122314 # CLIENTS SORTED BY FREQUENCY, BROWSER VERSIONS, WIKIMOBILE
2313 - $html .= "<tr><th class=l>&nbsp;<br>Wiki applications, mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
 2315+ $html .= "<tr><th class=l>&nbsp;<br>Mobile application versions</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
23142316 foreach $key (@clients_sorted_count)
23152317 {
23162318 $count = $clients {$key} ;
23172319 ($rectype, $client) = split (',', $key,2) ;
23182320 next if $rectype ne 'W' ; # group
23192321 $perc = $clients_perc {$key} ;
2320 - next if $perc lt "0.005%" ;
 2322+ next if $perc lt "0.001%" ;
23212323 $count = &FormatCount ($count) ;
23222324
23232325 $perc_html_only = $clients_perc_html_only {$key} ;
@@ -2408,7 +2410,7 @@
24092411 $html .= "<tr><th class=l>Total</th><th class=r>$total</th><th class=r>$perc_total_mobile\%</th><th class=r>$total_html_only</th><th class=r>$perc_total_html_only_mobile\%</th></tr>\n" ;
24102412
24112413 # CLIENTS IN ALPHABETHICAL ORDER, BROWSERS, WIKIMOBILE
2412 - $html .= "<tr><th class=l>&nbsp;<br>Applications, mobile</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
 2414+ $html .= "<tr><th class=l>&nbsp;<br>Mobile applications</th><th colspan=2 class=c>&nbsp;<br>All requests</th><th colspan=2 class=c>&nbsp;<br>Html pages</th></tr>\n" ;
24132415 foreach $key (@clientgroups_sorted_alpha)
24142416 {
24152417 $count = $clientgroups {$key} ;
@@ -2446,7 +2448,7 @@
24472449 ($rectype, $client) = split (',', $key,2) ;
24482450 next if $rectype ne '-' ; # group
24492451 $perc = $clients_perc {$key} ;
2450 - next if $perc lt "0.02%" ;
 2452+ next if $perc lt "0.005%" ;
24512453 $count = &FormatCount ($count) ;
24522454
24532455 $count_html_only = $clients_html_only {$key} ;

Status & tagging log