Index: trunk/wikistats/squids/SquidReportArchive.pl |
— | — | @@ -1,17 +1,13 @@ |
2 | 2 | #!/usr/bin/perl |
3 | 3 | |
4 | | - use config ; |
| 4 | + use SquidReportArchiveConfig ; |
5 | 5 | use lib $liblocation ; |
6 | 6 | |
7 | 7 | use EzLib ; |
8 | 8 | $trace_on_exit = $true ; |
9 | 9 | ez_lib_version (2) ; |
10 | 10 | |
11 | | -# set defaults mainly for tests on local machine |
12 | | -# default_argv "-m 2011-07 " ; |
13 | | - default_argv "-c -q 2011Q4" ; |
14 | | -# default_argv "-w" ; # refresh country info from Wikipedia (population etc) |
15 | | -# default_argv "-c" ; |
| 11 | + default_argv ($default_argv) ; |
16 | 12 | |
17 | 13 | # to do: add text from http://wiki.squid-cache.org/SquidFaq/SquidLogs |
18 | 14 | # ReportOrigin how to handle '!error <-> other |
— | — | @@ -42,17 +38,18 @@ |
43 | 39 | $path_in = "/a/ezachte" ; |
44 | 40 | $path_out = "/a/ezachte" ; |
45 | 41 | } |
46 | | - elsif ($hostname eq 'bayes') |
47 | | - { |
48 | | - &Log ("\n\nJob runs on server $hostname\n\n") ; |
49 | | - $path_in = "/home/ezachte/wikistats/animation" ; |
50 | | - $path_out = "/home/ezachte/wikistats/animation" ; |
51 | | - } |
| 42 | +# following test needs to change -> remove server name dependency (new run argument ?) |
| 43 | +# elsif ($hostname eq 'bayes') |
| 44 | +# { |
| 45 | +# &Log ("\n\nJob runs on server $hostname\n\n") ; |
| 46 | +# $path_in = "/home/ezachte/wikistats/animation" ; |
| 47 | +# $path_out = "/home/ezachte/wikistats/animation" ; |
| 48 | +# } |
52 | 49 | else |
53 | 50 | { |
54 | 51 | print "Job runs local for tests\n\n" ; |
55 | | - $path_in = "/srv/erik/" ; |
56 | | - $path_out = "/srv/erik/" ; |
| 52 | + $path_in = $path_in_local ; |
| 53 | + $path_out = $path_out_local ; |
57 | 54 | } |
58 | 55 | |
59 | 56 | &Log ("Path in = $path_in\n") ; |
— | — | @@ -667,9 +664,9 @@ |
668 | 665 | if ($mimecat eq 'page') |
669 | 666 | { |
670 | 667 | $total_clients_html_only += $count ; |
671 | | - if ($rectype eq "-") { $total_clients_non_mobile_html_only += $count ; } |
672 | | - if ($rectype eq "M") { $total_clients_mobile_html_only += $count ; } |
673 | | - if ($rectype eq "W") { $total_clients_wiki_mobile_html_only += $count ; } |
| 668 | + if ($rectype eq "-") { $total_clients_non_mobile_html_only += $count ; } |
| 669 | + if ($rectype eq "M") { $total_clients_mobile_html_only += $count ; } |
| 670 | + if ($rectype eq "W") { $total_clients_wiki_mobile_html_only += $count ; } |
674 | 671 | $clients_html_only {"$rectype,$client"} += $count ; |
675 | 672 | } |
676 | 673 | } |
— | — | @@ -874,7 +871,7 @@ |
875 | 872 | $line =~ s/^.*?: // ; |
876 | 873 | ($month_upd_keywords_mobile = $line) =~ s/^.*?\(([^\)]+)\).*$/$1/ ; |
877 | 874 | ($keywords_mobile = $line) =~ s/ \([^\)]+\).*$// ; |
878 | | - ($keywords_wiki_mobile = $line) =~ s/ \([^\)]+\).*$// ; |
| 875 | + ($keywords_wiki_mobile = $line) =~ s/ \([^\)]+\).*$// ; |
879 | 876 | $keywords_mobile =~ s/\|/, /g ; |
880 | 877 | $keywords_mobile =~ s/((?:[^,]+,){10})/$1<br>/g ; |
881 | 878 | $keywords_wiki_mobile =~ s/((?:[^,]+,){10})/$1<br>/g ; |
— | — | @@ -1931,9 +1928,9 @@ |
1932 | 1929 | $total_clients_wiki_mobile= &Normalize ($total_clients_wiki_mobile) ; |
1933 | 1930 | $total_clients_non_mobile = &Normalize ($total_clients_non_mobile) ; |
1934 | 1931 | |
1935 | | - $total_clients_html_only = &Normalize ($total_clients_html_only) ; |
1936 | | - $total_clients_mobile_html_only = &Normalize ($total_clients_mobile_html_only) ; |
1937 | | - $total_clients_non_mobile_html_only = &Normalize ($total_clients_non_mobile_html_only) ; |
| 1932 | + $total_clients_html_only = &Normalize ($total_clients_html_only) ; |
| 1933 | + $total_clients_mobile_html_only = &Normalize ($total_clients_mobile_html_only) ; |
| 1934 | + $total_clients_non_mobile_html_only = &Normalize ($total_clients_non_mobile_html_only) ; |
1938 | 1935 | $total_clients_wiki_mobile_html_only = &Normalize ($total_clients_wiki_mobile_html_only) ; |
1939 | 1936 | |
1940 | 1937 | # ReadInputCrawlers |
— | — | @@ -2379,7 +2376,7 @@ |
2380 | 2377 | $perc = ".." ; |
2381 | 2378 | if ($total_clientgroups {'-'} + $total_clientgroups {'M'} + $total_clientgroups {'W'}> 0) |
2382 | 2379 | { $perc = sprintf ("%.2f", 100 * $count / ($total_clientgroups {'-'} + $total_clientgroups {'M'} + $total_clientgroups {'W'})) ; } |
2383 | | - |
| 2380 | + |
2384 | 2381 | $count_html_only = $clientgroups_other_html_only {'-'} ; |
2385 | 2382 | $total_html_only = &FormatCount ($total_clientgroups_html_only {'-'}) ; |
2386 | 2383 | $perc_html_only = ".." ; |
Index: trunk/wikistats/squids/SquidReportArchiveConfig.pm |
— | — | @@ -0,0 +1,15 @@ |
| 2 | +#!/usr/bin/perl
|
| 3 | +
|
| 4 | + $liblocation = "/home/ezachte/lib" ;
|
| 5 | +
|
| 6 | +# $path_in_local = "W:/# Out Locke" ; # Erik
|
| 7 | +# $path_out_local = "W:/# Out Test/Locke" ; # Erik
|
| 8 | +
|
| 9 | + $path_in = "/srv/erik/" ; # Andr�
|
| 10 | + $path_out = "/srv/erik/" ; # Andr�
|
| 11 | +
|
| 12 | +# set defaults for tests on local machine
|
| 13 | +# $default_argv = "-m 2011-07" ; # monthly report
|
| 14 | +# $default_argv = "-w" ; # refresh country info from Wikipedia (population etc)
|
| 15 | +# $default_argv = "-c" ; # country/regional reports
|
| 16 | + $default_argv = "-c -q 2011Q4" ; # country/regional reports based on data for one quarter only
|