Index: trunk/wikistats/squids/SquidReportArchive.pl |
— | — | @@ -6,8 +6,8 @@ |
7 | 7 | ez_lib_version (2) ; |
8 | 8 | |
9 | 9 | # 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" ; |
12 | 12 | |
13 | 13 | # to do: add text from http://wiki.squid-cache.org/SquidFaq/SquidLogs |
14 | 14 | # ReportOrigin how to handle '!error <-> other |
— | — | @@ -117,11 +117,13 @@ |
118 | 118 | $file_html_methods = "SquidReportMethods.htm" ; |
119 | 119 | $file_html_origins = "SquidReportOrigins.htm" ; |
120 | 120 | $file_html_opsys = "SquidReportOperatingSystems.htm" ; |
| 121 | + $file_html_opsys_html = "SquidReportOperatingSystemsHtmlOnly.htm" ; |
121 | 122 | $file_html_scripts = "SquidReportScripts.htm" ; |
122 | 123 | $file_html_skins = "SquidReportSkins.htm" ; |
123 | 124 | $file_html_requests = "SquidReportRequests.htm" ; |
124 | 125 | $file_html_google = "SquidReportGoogle.htm" ; |
125 | 126 | $file_html_clients = "SquidReportClients.htm" ; |
| 127 | + $file_html_clients_html = "SquidReportClientsHtmlOnly.htm" ; |
126 | 128 | |
127 | 129 | # names till 2010-07-01 |
128 | 130 | # |
— | — | @@ -304,16 +306,6 @@ |
305 | 307 | # &WriteCsvCountriesTargets ; |
306 | 308 | close "FILE_LOG" ; |
307 | 309 | |
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 | | - |
318 | 310 | print "\nReady\n\n" ; |
319 | 311 | exit ; |
320 | 312 | |
— | — | @@ -561,9 +553,10 @@ |
562 | 554 | |
563 | 555 | chomp ($line) ; |
564 | 556 | |
| 557 | + $mimecat = '' ; # page/image/other |
565 | 558 | if ($line =~ /^E/) |
566 | 559 | { |
567 | | - ($rectype, $engine, $count) = split (',', $line) ; |
| 560 | + ($rectype, $engine, $count,$mimecat) = split (',', $line) ; |
568 | 561 | |
569 | 562 | next if ($engine !~ /^Gecko/) && ($engine !~ /^AppleWebKit/) ; |
570 | 563 | |
— | — | @@ -589,7 +582,11 @@ |
590 | 583 | } |
591 | 584 | elsif ($line =~ /^G/) |
592 | 585 | { |
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 | + |
594 | 591 | $total_clientgroups {$mobile} += $count ; |
595 | 592 | |
596 | 593 | $group =~ s/^KDDI.*$/KDDI/ ; |
— | — | @@ -604,19 +601,38 @@ |
605 | 602 | $group =~ s/^PANTECH.*$/PanTech/i ; |
606 | 603 | $group =~ s/^Palm_Pre/Palm Pre/i ; |
607 | 604 | $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 | + } |
608 | 611 | } |
609 | 612 | else |
610 | 613 | { |
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) ; } |
612 | 618 | |
613 | 619 | $total_clients += $count ; |
| 620 | + |
614 | 621 | $client =~ s/_/./g ; |
615 | 622 | $client =~ s/\.\./Other/g ; |
616 | 623 | if ($client !=~ / \d/) |
617 | 624 | { $client =~ s/\// / ; } |
618 | 625 | if ($rectype eq "-") { $total_clients_non_mobile += $count ; } |
619 | 626 | if ($rectype eq "M") { $total_clients_mobile += $count ; } |
| 627 | + |
620 | 628 | $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 | + } |
621 | 637 | } |
622 | 638 | } |
623 | 639 | close CSV_CLIENTS ; |
— | — | @@ -820,8 +836,13 @@ |
821 | 837 | next if $line =~ /^:/ ; # csv header (not a comment) |
822 | 838 | |
823 | 839 | chomp $line ; |
824 | | - ($rectype, $os, $count, $perc) = split (',', $line) ; |
825 | 840 | |
| 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 | + |
826 | 847 | next if $count !~ /^\d+$/ ; # -,Linux Gentoo,,2,0.00% (extra comma !) |
827 | 848 | |
828 | 849 | $os =~ s/_/./g ; |
— | — | @@ -838,6 +859,13 @@ |
839 | 860 | if ($rectype eq "M") { $total_opsys_mobile += $count ; } |
840 | 861 | |
841 | 862 | $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 | + } |
842 | 870 | } |
843 | 871 | } |
844 | 872 | |
— | — | @@ -1738,28 +1766,41 @@ |
1739 | 1767 | |
1740 | 1768 | sub CalcPercentages |
1741 | 1769 | { |
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 ; |
1743 | 1772 | foreach $key (keys %opsys) |
1744 | 1773 | { $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)) . "%" ; } |
1745 | 1776 | |
1746 | 1777 | foreach $key (keys %clients) |
1747 | 1778 | { $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)) . "%" ; } |
1748 | 1781 | |
1749 | 1782 | foreach $key (keys %clientgroups) |
1750 | 1783 | { |
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 ; |
1752 | 1786 | if ($key =~ /^M/) |
1753 | 1787 | { $perc_threshold = 0.005 ; } |
1754 | 1788 | else |
1755 | 1789 | { $perc_threshold = 0.02 ; } |
1756 | 1790 | |
1757 | 1791 | 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 | + } |
1759 | 1796 | else |
1760 | 1797 | { |
1761 | 1798 | ($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 ; |
1764 | 1805 | } |
1765 | 1806 | } |
1766 | 1807 | } |
— | — | @@ -1773,15 +1814,27 @@ |
1774 | 1815 | foreach $key (keys %clientgroups) |
1775 | 1816 | { $clientgroups {$key} = &Normalize ($clientgroups {$key}) ; } |
1776 | 1817 | |
| 1818 | + foreach $key (keys %clientgroups_html_only) |
| 1819 | + { $clientgroups_html_only {$key} = &Normalize ($clientgroups_html_only {$key}) ; } |
| 1820 | + |
1777 | 1821 | foreach $key (keys %clients) |
1778 | 1822 | { $clients {$key} = &Normalize ($clients {$key}) ; } |
1779 | 1823 | |
| 1824 | + foreach $key (keys %clients_html_only) |
| 1825 | + { $clients_html_only {$key} = &Normalize ($clients_html_only {$key}) ; } |
| 1826 | + |
1780 | 1827 | foreach $key (keys %clientgroups_other) |
1781 | 1828 | { $clientgroups_other {$key} = &Normalize ($clientgroups_other {$key}) ; } |
1782 | 1829 | |
| 1830 | + foreach $key (keys %clientgroups_other_html_only) |
| 1831 | + { $clientgroups_other_html_only {$key} = &Normalize ($clientgroups_other_html_only {$key}) ; } |
| 1832 | + |
1783 | 1833 | foreach $key (keys %total_clientgroups) |
1784 | 1834 | { $total_clientgroups {$key} = &Normalize ($total_clientgroups {$key}) ; } |
1785 | 1835 | |
| 1836 | + foreach $key (keys %total_clientgroups_html_only) |
| 1837 | + { $total_clientgroups_html_only {$key} = &Normalize ($total_clientgroups_html_only {$key}) ; } |
| 1838 | + |
1786 | 1839 | foreach $key (keys %total_engines) |
1787 | 1840 | { $total_engines {$key} = &Normalize ($total_engines {$key}) ; } |
1788 | 1841 | |
— | — | @@ -1792,6 +1845,10 @@ |
1793 | 1846 | $total_clients_mobile = &Normalize ($total_clients_mobile) ; |
1794 | 1847 | $total_clients_non_mobile = &Normalize ($total_clients_non_mobile) ; |
1795 | 1848 | |
| 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 | + |
1796 | 1853 | # ReadInputCrawlers |
1797 | 1854 | foreach $key (keys %crawlers) |
1798 | 1855 | { $crawlers {$key} = &Normalize ($crawlers {$key}) ; } |
— | — | @@ -1958,6 +2015,7 @@ |
1959 | 2016 | |
1960 | 2017 | sub WriteReportClients |
1961 | 2018 | { |
| 2019 | + print "\nWriteReportClients -> $path_reports/$file_html_clients\n\n" ; |
1962 | 2020 | open FILE_HTML_CLIENTS, '>', "$path_reports/$file_html_clients" ; |
1963 | 2021 | |
1964 | 2022 | $html = $header ; |
— | — | @@ -1975,27 +2033,34 @@ |
1976 | 2034 | "</td></tr>\n" ; |
1977 | 2035 | |
1978 | 2036 | # CLIENTS SORTED BY FREQUENCY |
1979 | | - $html .= "<tr><td width=50% valign=top>" ; |
| 2037 | + $html .= "<tr><td width=50% valign=top style='vertical-align:top'>" ; |
1980 | 2038 | $html .= "<table border=1 width=100%>\n" ; |
1981 | 2039 | $html .= "<tr><th colspan=99 class=l><h3>In order of popularity</h3></th></tr>\n" ; |
1982 | 2040 | |
1983 | | - $html .= "<tr><th colspan=99 class=l> <br>Browsers, non mobile</th></tr>\n" ; |
| 2041 | + # CLIENTS SORTED BY FREQUENCY, BROWSERS, NON MOBILE |
| 2042 | + $html .= "<tr><th class=l> <br>Browsers, non mobile</th><th colspan=2 class=c> <br>All requests</th><th colspan=2 class=c> <br>Html pages</th></tr>\n" ; |
1984 | 2043 | $perc_total = 0 ; |
| 2044 | + $perc_total_html_only = 0 ; |
1985 | 2045 | foreach $key (@clientgroups_sorted_count) |
1986 | 2046 | { |
1987 | 2047 | $count = $clientgroups {$key} ; |
1988 | | - |
1989 | 2048 | next if $count == 0 ; |
1990 | | - |
1991 | 2049 | $perc = $clientgroups_perc {$key} ; |
1992 | 2050 | ($mobile,$group) = split (',', $key) ; |
1993 | | - |
1994 | 2051 | next if $mobile ne '-' ; |
| 2052 | + $count = &FormatCount ($count) ; |
1995 | 2053 | |
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 | + |
1998 | 2060 | $perc =~ s/\%// ; |
| 2061 | + $perc_html_only =~ s/\%// ; |
| 2062 | + |
1999 | 2063 | $perc_total += $perc ; |
| 2064 | + $perc_total_html_only += $perc_html_only ; |
2000 | 2065 | } |
2001 | 2066 | |
2002 | 2067 | $perc = ".." ; |
— | — | @@ -2005,104 +2070,146 @@ |
2006 | 2071 | $perc = sprintf ("%.2f", 100 * $clientgroups_other {'-'} / ($total_clientgroups {'-'} + $total_clientgroups {'M'})) ; |
2007 | 2072 | $perc_total += $perc ; |
2008 | 2073 | } |
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 | + } |
2010 | 2081 | |
| 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 | + |
2011 | 2084 | $total = &FormatCount ($total_clientgroups {'-'}) ; |
2012 | 2085 | $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" ; |
2014 | 2086 | |
2015 | | - $html .= "<tr><th colspan=99 class=l> <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> <br>Browsers, mobile</th><th colspan=2 class=c> <br>All requests</th><th colspan=2 class=c> <br>Html pages</th></tr>\n" ; |
2016 | 2094 | foreach $key (@clientgroups_sorted_count) |
2017 | 2095 | { |
2018 | 2096 | $count = $clientgroups {$key} ; |
2019 | | - |
2020 | 2097 | next if $count == 0 ; |
2021 | | - |
2022 | 2098 | $perc = $clientgroups_perc {$key} ; |
2023 | 2099 | ($mobile,$group) = split (',', $key) ; |
2024 | | - |
2025 | 2100 | next if $mobile ne 'M' ; |
| 2101 | + $count = &FormatCount ($count) ; |
2026 | 2102 | |
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" ; |
2029 | 2108 | $perc =~ s/\%// ; |
2030 | 2109 | } |
| 2110 | + |
2031 | 2111 | $count = $clientgroups_other {'M'} ; |
2032 | | - |
2033 | 2112 | $perc = ".." ; |
2034 | 2113 | if ($total_clientgroups {'-'} + $total_clientgroups {'M'} > 0) |
2035 | 2114 | { $perc = sprintf ("%.2f", 100 * $count / ($total_clientgroups {'-'} + $total_clientgroups {'M'})) ; } |
2036 | 2115 | |
| 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 | + |
2037 | 2121 | $perc_total = sprintf ("%.1f", (100 - $perc_total)) ; |
2038 | 2122 | $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" ; |
2041 | 2123 | |
2042 | | - $html .= "<tr><th colspan=99 class=l> <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'}) ; |
2043 | 2126 | |
| 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> <br>Browser versions, non mobile</th><th colspan=2 class=c> <br>All requests</th><th colspan=2 class=c> <br>Html pages</th></tr>\n" ; |
| 2132 | + |
2044 | 2133 | foreach $key (@clients_sorted_count) |
2045 | 2134 | { |
2046 | 2135 | $count = $clients {$key} ; |
2047 | 2136 | ($rectype, $client) = split (',', $key,2) ; |
2048 | | - |
2049 | 2137 | next if $rectype ne '-' ; # group |
2050 | | - |
2051 | 2138 | $perc = $clients_perc {$key} ; |
2052 | | - |
2053 | 2139 | next if $perc lt "0.02%" ; |
| 2140 | + $count = &FormatCount ($count) ; |
2054 | 2141 | |
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" ; |
2057 | 2146 | $perc =~ s/\%// ; |
2058 | 2147 | } |
| 2148 | + |
2059 | 2149 | $total = &FormatCount ($total_clients_non_mobile) ; |
2060 | | - |
2061 | 2150 | $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" ; |
2063 | 2151 | |
2064 | | - $html .= "<tr><th colspan=99 class=l> <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> <br>Browser versions, mobile</th><th colspan=2 class=c> <br>All requests</th><th colspan=2 class=c> <br>Html pages</th></tr>\n" ; |
2065 | 2159 | foreach $key (@clients_sorted_count) |
2066 | 2160 | { |
2067 | 2161 | $count = $clients {$key} ; |
2068 | 2162 | ($rectype, $client) = split (',', $key,2) ; |
2069 | | - |
2070 | 2163 | next if $rectype ne 'M' ; # group |
2071 | | - |
2072 | 2164 | $perc = $clients_perc {$key} ; |
2073 | | - |
2074 | 2165 | next if $perc lt "0.02%" ; |
| 2166 | + $count = &FormatCount ($count) ; |
2075 | 2167 | |
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" ; |
2078 | 2173 | } |
| 2174 | + |
2079 | 2175 | $total = &FormatCount ($total_clients_mobile) ; |
2080 | 2176 | $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" ; |
2082 | 2177 | |
| 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 | + |
2083 | 2183 | $html .= "</table>\n" ; |
2084 | 2184 | |
2085 | | - # CLIENTS In alphabetical order |
| 2185 | + # CLIENTS IN ALPHABETHICAL ORDER |
2086 | 2186 | $html .= "</td><td width=50% valign=top>" ; |
2087 | 2187 | $html .= "<table border=1 width=100%>\n" ; |
2088 | 2188 | $html .= "<tr><th colspan=99 class=l><h3>In alphabetical order</h3></th></tr>\n" ; |
2089 | 2189 | |
2090 | | - $html .= "<tr><th colspan=99 class=l> <br>Browsers, non mobile</th></tr>\n" ; |
| 2190 | + # CLIENTS IN ALPHABETHICAL ORDER, BROWSERS, NON MOBILE |
| 2191 | + $html .= "<tr><th class=l> <br>Browsers, non mobile</th><th colspan=2 class=c> <br>All requests</th><th colspan=2 class=c> <br>Html pages</th></tr>\n" ; |
2091 | 2192 | $perc_total = 0 ; |
| 2193 | + $perc_total_html_only = 0 ; |
2092 | 2194 | foreach $key (@clientgroups_sorted_alpha) |
2093 | 2195 | { |
2094 | 2196 | $count = $clientgroups {$key} ; |
2095 | | - |
2096 | 2197 | next if $count == 0 ; |
2097 | | - |
2098 | 2198 | $perc = $clientgroups_perc {$key} ; |
2099 | 2199 | ($mobile,$group) = split (',', $key) ; |
2100 | | - |
2101 | 2200 | next if $mobile ne '-' ; |
| 2201 | + $count = &FormatCount ($count) ; |
2102 | 2202 | |
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 | + |
2105 | 2209 | $perc =~ s/\%// ; |
2106 | 2210 | $perc_total += $perc ; |
| 2211 | + |
| 2212 | + $perc_html_only =~ s/\%// ; |
| 2213 | + $perc_total_html_only += $perc_html_only ; |
2107 | 2214 | } |
2108 | 2215 | |
2109 | 2216 | $count = $clientgroups_other {'-'} ; |
— | — | @@ -2112,71 +2219,101 @@ |
2113 | 2220 | { $perc = sprintf ("%.2f", 100 * $count / ($total_clientgroups {'-'} + $total_clientgroups {'M'})) ; } |
2114 | 2221 | $perc_total += $perc ; |
2115 | 2222 | $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" ; |
2118 | 2223 | |
2119 | | - $html .= "<tr><th colspan=99 class=l> <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> <br>Browsers, mobile</th><th colspan=2 class=c> <br>All requests</th><th colspan=2 class=c> <br>Html pages</th></tr>\n" ; |
2120 | 2237 | foreach $key (@clientgroups_sorted_alpha) |
2121 | 2238 | { |
2122 | 2239 | $count = $clientgroups {$key} ; |
2123 | | - |
2124 | 2240 | next if $count == 0 ; |
2125 | | - |
2126 | 2241 | $perc = $clientgroups_perc {$key} ; |
2127 | 2242 | ($mobile,$group) = split (',', $key) ; |
2128 | | - |
2129 | 2243 | next if $mobile ne 'M' ; |
| 2244 | + $count = &FormatCount ($count) ; |
2130 | 2245 | |
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" ; |
2133 | 2251 | $perc =~ s/\%// ; |
2134 | 2252 | } |
| 2253 | + |
2135 | 2254 | $count = $clientgroups_other {'M'} ; |
2136 | 2255 | $total = &FormatCount ($total_clientgroups {'M'}) ; |
2137 | 2256 | $perc = sprintf ("%.2f", 100 * $count / ($total_clientgroups {'-'} + $total_clientgroups {'M'})) ; |
2138 | 2257 | $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" ; |
2141 | 2258 | |
2142 | | - $html .= "<tr><th colspan=99 class=l> <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)) ; |
2143 | 2263 | |
| 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> <br>Browser versions, non mobile</th><th colspan=2 class=c> <br>All requests</th><th colspan=2 class=c> <br>Html pages</th></tr>\n" ; |
| 2269 | + |
2144 | 2270 | foreach $key (@clients_sorted_alpha) |
2145 | 2271 | { |
2146 | 2272 | $count = $clients {$key} ; |
2147 | 2273 | ($rectype, $client) = split (',', $key,2) ; |
2148 | | - |
2149 | 2274 | next if $rectype ne '-' ; # group |
2150 | | - |
2151 | 2275 | $perc = $clients_perc {$key} ; |
2152 | | - |
2153 | 2276 | next if $perc lt "0.02%" ; |
| 2277 | + $count = &FormatCount ($count) ; |
2154 | 2278 | |
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" ; |
2157 | 2284 | } |
2158 | 2285 | $total = &FormatCount ($total_clients_non_mobile) ; |
2159 | 2286 | $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" ; |
2161 | 2287 | |
2162 | | - $html .= "<tr><th colspan=99 class=l> <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> <br>Browser versions, mobile</th><th colspan=2 class=c> <br>All requests</th><th colspan=2 class=c> <br>Html pages</th></tr>\n" ; |
2163 | 2295 | foreach $key (@clients_sorted_alpha) |
2164 | 2296 | { |
2165 | 2297 | $count = $clients {$key} ; |
2166 | 2298 | ($rectype, $client) = split (',', $key,2) ; |
2167 | | - |
2168 | 2299 | next if $rectype ne 'M' ; # group |
2169 | | - |
2170 | 2300 | $perc = $clients_perc {$key} ; |
2171 | | - |
2172 | 2301 | next if $perc lt "0.02%" ; |
| 2302 | + $count = &FormatCount ($count) ; |
2173 | 2303 | |
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" ; |
2176 | 2309 | } |
2177 | 2310 | $total = &FormatCount ($total_clients_mobile) ; |
2178 | 2311 | $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" ; |
2180 | 2312 | |
| 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 | + |
2181 | 2318 | $html .= "<tr><th colspan=99 class=l> <br>Browser engines</th></tr>\n" ; |
2182 | 2319 | |
2183 | 2320 | $engine_prev = "" ; |
— | — | @@ -4931,7 +5068,7 @@ |
4932 | 5069 | # print "Convert world_map_$period.svg to gif\n" ; |
4933 | 5070 | # `svg/convert.exe svg/world_map_$period.svg gif:svg/world_map_$period.gif` ; |
4934 | 5071 | |
4935 | | -# exit ; # qqq |
| 5072 | +# exit ; |
4936 | 5073 | # exit ; |
4937 | 5074 | # sleep (2) ; # until computer fan fixed |
4938 | 5075 | } |